Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created February 9, 2019 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/eb2ef229d3b6841d5757e39e1b6ff5d3 to your computer and use it in GitHub Desktop.
Save arun12209/eb2ef229d3b6841d5757e39e1b6ff5d3 to your computer and use it in GitHub Desktop.
({
doInit :function(component,event,helper){
// Apex method definition
var action = component.get("c.loadData");
// callbak function
action.setCallback(this,function(response){
//get state
var state = response.getState();
// check if state is 'SUCCESS'
if(state == 'SUCCESS'){
var result = response.getReturnValue();
//set value to "UnfilteredData" attaribute
component.set("v.UnfilteredData",result);
console.log(result);
// set value to "data" attaribute
component.set("v.data",result);
}else{
console.log('something bad happend! ');
}
});
// put the action into queue for server call.
$A.enqueueAction(action);
},
doFilter: function(component, event, helper) {
//calling helper
helper.FilterRecords(component);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment