This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
fetchAccounts : function(component, event, helper) { | |
helper.getAllAccounts(component, helper); | |
}, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Exntends Base Component in Component Definition --> | |
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="AccountController" access="global" > | |
<aura:attribute name="data" type="Account[]"/> | |
<!-- Including BaseJS script. Once loaded call fetchAccounts method --> | |
<ltng:require scripts="{!$Resource.BaseJS}" | |
afterScriptsLoaded="{!c.fetchAccounts}"/> | |
<aura:iteration items="{!v.data}" var="acc"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This method will call the server side action and will execute callback method | |
* it will also show error if generated any | |
* @param method (required) - Server side methos name | |
* @param callback (required) - Callback function to be executed on server response | |
* @param params (optional) - parameter values to pass to server | |
* @param setStorable(optional) - if true, action response will be stored in cache | |
* */ | |
window.callServer = function(component, method, callback, params, setStorable) { | |
var action = component.get(method); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* Retrieve the data from server | |
* call prepareData function to filter out unnecessary data | |
* */ | |
onInit : function(component, event, helper) { | |
var action = component.get("c.getRecords"); | |
action.setStorable(); | |
action.setCallback(this,function(response) { | |
var state = response.getState(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit : function(component, event, helper) { | |
helper.onInit(component, event, helper); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" | |
controller="AuraIfTester" | |
access="global" > | |
<aura:attribute name="records" type="list" /> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<table style="border-color: grey; float: left;" border="1" cellspacing="4" cellpadding="4"> | |
<tbody> | |
<aura:iteration items="{!v.records}" var="item"> | |
<tr> | |
<td>{!item.Name}</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* Retrieve the data from server | |
* */ | |
onInit : function(component, event, helper) { | |
var action = component.get("c.getRecords"); | |
action.setStorable(); | |
action.setCallback(this,function(response) { | |
console.log('Response Time: '+((new Date().getTime())-requestInitiatedTime)); | |
var state = response.getState(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
doInit : function(component, event, helper) { | |
helper.onInit(component, event, helper); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" | |
controller="AuraIfTester" | |
access="global" > | |
<aura:attribute name="records" type="list" /> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<table style="border-color: grey; float: left;" border="1" cellspacing="4" cellpadding="4"> | |
<tbody> | |
<aura:iteration items="{!v.records}" var="item"> | |
<!-- Check if row needs to shown --> | |
<aura:if isTrue="{!item.Show_Me__c}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AuraIfTester | |
{ | |
/** | |
* Function to get all AuraIFTester records | |
* */ | |
@AuraEnabled | |
public static List<AuraIfTester__c> getRecords() | |
{ | |
return [SELECT | |
Id, //Record ID |