Last active
June 28, 2018 09:55
-
-
Save choudharymanish8585/81c6196b8d4929cc56a71849c1a50f08 to your computer and use it in GitHub Desktop.
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
({ | |
getAccounts : function(component, helper) { | |
var action = component.get("c.getAccountsWithOffset"); | |
action.setStorable(); | |
action.setParams({ | |
'pageSize' : component.get("v.pageSize").toString(), | |
'pageNumber' : component.get("v.pageNumber").toString() | |
}); | |
action.setCallback(this,function(response) { | |
var state = response.getState(); | |
if (state === "SUCCESS") { | |
console.log('Response Time: '+((new Date().getTime())-requestInitiatedTime)); | |
if(response.getReturnValue().length < component.get("v.pageSize")){ | |
component.set("v.isLastPage", true); | |
} else{ | |
component.set("v.isLastPage", false); | |
} | |
component.set("v.resultSize", response.getReturnValue().length); | |
component.set("v.data", response.getReturnValue()); | |
} | |
}); | |
var requestInitiatedTime = new Date().getTime(); | |
$A.enqueueAction(action); | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment