Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1817

Inconcistent iDisplayStart value when bStateSave, bServerside, bPaginate

$
0
0
I am using bStateSave and bootstrap pagination with serverside data with DataTables 1.9.4. I initially load the table which has 1000 rows and I navigate to the last page which has row numbers 950 to 1000. Then on reloading the page with a different query which has only 500 rows, due to bStatesave, the iDisplayStart value remains 950 instead of beginning from 0.
So no data is displayed in the table and the info section of datatable says - "Showing 950 to 500 of 500 entries"

This is my initialization code.
var oTable = $('#sampleTable').dataTable({
"sScrollY":"500px",
"bProcessing":true,
"bServerSide":true,
"bStateSave":true,
"sDom":'Crtipl',
"sAjaxSource":"http://testing/test.htmlx",
"iDisplayLength":50,
"bPaginate":true,
"sPaginationType":"bootstrap",
"aoColumns": [
{"mDataProp": "id"},
{"mDataProp": function(source){
return "<pre>"+source.description+"</pre>"
}},
{"mDataProp": createdBy"}
],
"fnRowCallback":function(nRow, aData, iDisplayIndex){
$(nRow).on('click',$(nRow),function(){
console.log(aData);
document.location.href="edit.htmlx"
});
}
});

How to navigate to the first page and show 1-50 entries in this case ? bStateSave has to be true to save the column sorting information on reload.

Thanks,
Darsheet.

Viewing all articles
Browse latest Browse all 1817

Trending Articles