You need to sign in to do that
Don't have an account?
Apar Jaggi 6
the action.setCallback state is returning an error
loadMoreData:function(component,event,helper){
event.getSource().set("v.isLoading", true);
component.set('v.loadMoreStatus', 'Loading....');
var totalNumberofRows=component.get('v.totalNumberOfRows');
var currentData=component.get("v.data");
var counts = component.get("v.currentCount");
var recordLimit=component.get("v.initialRows");
if(component.get('v.data').length>=component.get('v.totalNumberOfRows')){
// console.log("inside if");
component.set('v.enableInfiniteLoading', false);
component.set('v.loadMoreStatus', 'No more data to load');
}else{
var action=component.get("c.fetchRecordData");
action.setParams({
limitCount: recordLimit,
offSetCount: counts
});
action.setCallback(this,function(response){
var state=response.getState();
console.log(state);
if(state === "SUCCESS"){
var newData=response.getReturnValue();
console.log(newData);
/* component.set("v.data",newData);
component.set("v.currentCount",(counts+recordLimit));*/
}
});
$A.enqueueAction(action);
}
}
event.getSource().set("v.isLoading", true);
component.set('v.loadMoreStatus', 'Loading....');
var totalNumberofRows=component.get('v.totalNumberOfRows');
var currentData=component.get("v.data");
var counts = component.get("v.currentCount");
var recordLimit=component.get("v.initialRows");
if(component.get('v.data').length>=component.get('v.totalNumberOfRows')){
// console.log("inside if");
component.set('v.enableInfiniteLoading', false);
component.set('v.loadMoreStatus', 'No more data to load');
}else{
var action=component.get("c.fetchRecordData");
action.setParams({
limitCount: recordLimit,
offSetCount: counts
});
action.setCallback(this,function(response){
var state=response.getState();
console.log(state);
if(state === "SUCCESS"){
var newData=response.getReturnValue();
console.log(newData);
/* component.set("v.data",newData);
component.set("v.currentCount",(counts+recordLimit));*/
}
});
$A.enqueueAction(action);
}
}
What is the error you are seeing?