Serverside Pagination is not making calls to server API when clicked on next.

Serverside Pagination is not making calls to server API when clicked on next.

amunnamgamunnamg Posts: 1Questions: 0Answers: 0
edited December 2013 in Editor
Hi Allan
Thanks for a wonderful plug in. We have a requirement to do serverside pagination. Each click on Next button should make a server call(Post request) to Rest API and fetch data. All the data is fetched in one ajax call and for subsequent requests are not making server call.Could not really figure out what is missing out here. Can you please let me know if anything obvious is missing.

Thanks


Javascript call to load serverside data.
[code]
/* Generic Search that retrieves values from server side*/
function serverSideSearch(beanName,searchString,divName){
var getURL = "http://amunnamg-op755.callidussoftware.com:8080/TerritoryQuotaMgr/services/rest/bean/filter";
var offset = 0;
var queryFilter = new RESTQueryFilter(beanName,searchString,50,offset);
var searchQueryData = JSON.stringify(ko.mapping.toJS(queryFilter));
var levelOfDetails = 1;
var divName = 'example';
$('divName').innerHTML='';
addPlaceHolderForDataTable(columns,divName);
$('#tableId').dataTable( {
"bScrollInfinite": false,
"bScrollCollapse": true,
"sScrollY": "200px",
"bProcessing": true,
"bServerSide": true,
"iTotalRecords":1000,
"iTotalDisplayRecords":1000,
"bFilter": false,
//"iDisplayStart":10,
//"iDisplayLength":10,
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
payLoadDT = aoData;
aoData = '';
aoData = searchQueryData;
oSettings.jqXHR = $.ajax( {
"contentType": "application/json",
"dataType": 'json',
"type": "POST",
"url": getURL,
"data": aoData,
"success": function(data){
//aoData = payLoadDT;
var totalRecords = data[0].total;
$('example').innerHTML='';
var divName = 'example';
addPlaceHolderForDataTable(columns,divName);
data = data[0].beans;
//add data for table, didnot do anything.

//fnCallback(payLoadDT,data);

oTable = $('#tableId').dataTable( {
"aaData":data,
"aoColumns":columnData,
//this enables or disables search text box above table based on value passed.
"bFilter": false,
"sScrollX": "100%",
"bScrollInfinite": false,
"bScrollCollapse": true,
"sScrollY": "200px",
"bScrollCollapse": true,
"bPaginate": true,
"iTotalRecords":1000,
"iTotalDisplayRecords":1000,
"iDisplayStart":10,
"iDisplayLength":10

} );

}//fnCallback
} );
}
} );


}
[/code]


Thanks.

Appreciate help on this.
This discussion has been closed.