Skip to content

Instantly share code, notes, and snippets.

@Rahman123
Rahman123 / filter.app
Created February 24, 2018 04:34 — forked from brianmfear/filter.app
Lightning Add/Filter List
<aura:application extends="force:slds">
<!-- All items added to the list -->
<aura:attribute name="data" type="List" default="[]" />
<!-- The list of currently viewable items -->
<aura:attribute name="filteredData" type="List" default="[]" />
<!-- Input for a new item -->
<aura:attribute name="newItem" type="String" />
<!-- Input for the filter text -->
<aura:attribute name="filter" type="String" />
@Rahman123
Rahman123 / progressRing.cmp
Created February 24, 2018 03:01 — forked from brianmfear/progressRing.cmp
LightningProgressRing component
<aura:component >
<aura:attribute name="value" type="Integer" default="0" />
<aura:attribute name="variant" type="String" />
<aura:attribute name="hasVariant" type="Boolean" access="private" default="{!false}" />
<aura:attribute name="ringClass" type="String" access="private" />
<aura:attribute name="iconName" type="String" access="private" />
<aura:attribute name="altText" type="String" access="private" />
<aura:handler name="init" value="{!this}" action="{!c.updateView}" />
@Rahman123
Rahman123 / PagingSortingController.cls
Created January 10, 2018 21:46 — forked from brianmfear/PagingSortingController.cls
Lightning Paging and Sorting Demo
global class PagingSortingController {
@AuraEnabled global static Account[] getAccounts() {
return [SELECT Name, Industry, AnnualRevenue FROM Account LIMIT 1000];
}
}
@Rahman123
Rahman123 / PageController.apxc
Created January 10, 2018 21:46 — forked from brianmfear/PageController.apxc
Example Image Uploader in Visualforce
public class PageController {
// Transient so we don't exceed view state limits
public transient String fileType { get; set; }
public transient Blob fileBody { get; set; }
ApexPages.StandardController controller;
public PageController(ApexPages.StandardController controller) {
this.controller = controller;
}
public class ServerSide50KPagination {
Id[] recordIds;
public Integer maxPage { get; set; }
public Integer pageNumber { get; set; }
public Integer pageSize { get; set; }
public Account[] records { get; set; }
public ServerSide50KPagination() {
recordIds = new Id[0];
for(Account record: [SELECT Id FROM Account ORDER BY Name]) {
@Rahman123
Rahman123 / toaster.cmp
Created September 29, 2017 02:21 — forked from pozil/toaster.cmp
Lightning - Displaying a system toast with a few lines of code
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
<div class="slds-m-around--xx-large slds-text-align--center">
<lightning:button label="Fire toast event" onclick="{! c.fireToastEvent }"/>
</div>
</aura:component>
@Rahman123
Rahman123 / inputRating.cmp
Created October 2, 2016 22:11 — forked from peterknolle/inputRating.cmp
Input Rating Lightning Component
<aura:component >
<ltng:require scripts="/resource/rating/vendor/jquery.js,/resource/rating/lib/jquery.raty.js"
styles="/resource/rating/lib/jquery.raty.css"
afterScriptsLoaded="{!c.afterScriptsLoaded}"/>
<aura:attribute name="value" type="Integer" required="true"/>
<aura:attribute name="ready" type="Boolean" default="false"/>
<div aura:id="rating"></div>
</aura:component>
<apex:page standardStylesheets="true" showHeader="true" sidebar="true">
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet"/>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,700italic' rel='stylesheet' type='text/css' />
<!-- Compiled and minified CSS -->
<!-- Latest compiled and minified CSS -->
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
/* Code for Responsive Nature */
@Rahman123
Rahman123 / VFBootstrapSample
Created February 6, 2016 03:57 — forked from anupj/VFBootstrapSample
Use Bootstrap with Visualforce on the Force.com platform
<apex:page showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0" language="en-US" applyHTMLTag="false">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Anup's Bootstrap example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Bootstrap -->
<link href="{!URLFOR($Resource.Bootstrap_3_0_3, 'dist/css/bootstrap.min.css')}" rel="stylesheet" />
public class FileController {
@AuraEnabled
public static Id saveTheFile(Id parentId, String fileName, String base64Data, String contentType) {
base64Data = EncodingUtil.urlDecode(base64Data, 'UTF-8');
Attachment a = new Attachment();
a.parentId = parentId;
a.Body = EncodingUtil.base64Decode(base64Data);