Salesforce Apex

Salesforce

Simple Pagination Example in Lightning Component

Sample Code: Component: <aura:component implements="force:appHostable" controller="OpportunitySearchController"> <aura:attribute name="oppty" type="Opportunity" default="{ 'sobjectType': 'Opportunity'}"/> <aura:attribute name="columns" type="List"/> <aura:attribute name="opportunityList" type="Opportunity[]"/> <aura:attribute name="PaginationList" type="Opportunity[]"/> <aura:attribute name="startPage" type="Integer" /> <aura:attribute name="endPage" type="Integer"/> <aura:attribute name="totalRecords" ....

Salesforce

Lighting Data Table Sorting Example

AccountList.cmp <aura:component controller="AccountListController"                 implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" >          <aura:attribute type="Account[]" name="acctList"/>     <aura:attribute name="mycolumns" type="List"/>     <aura:attribute name="sortedBy" type="String" ....

Salesforce

lightning:datatable in Salesforce Lightning Component

AccountList.cmp: <aura:component controller="AccountListController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" > <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="mycolumns" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <lightning:datatable data="{! v.acctList }" columns="{! v.mycolumns }" keyField="id" hideCheckboxColumn="true"/> </aura:component> AccountListController.js ({ fetchAccounts : function(component, ....

Salesforce

force:navigateToURL example in Salesforce Lightning

force:navigateToURL can be used for Navigation in Salesforce Lightning. AccountList.cmp: <aura:component controller="AccountListController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" > <aura:attribute type="Account[]" name="acctList"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <table class="slds-table slds-table_bordered slds-table_cell-buffer"> <thead> <tr class="slds-text-title_caps"> <th scope="col"> ....