How save state pagination after reload page?
How save state pagination after reload page?
Good day. I insert data for Datatable from ajax request. How save state pagination after reload page? Setting "bProcessing": true doesn't work
Simple code for load DataTable:
[code]
oTable = $('#rss_source').dataTable( {
"sPaginationType": "full_numbers",
"bProcessing": true,
"sAjaxSource": "/admin/load_data/load_rss_sources",
"aaSorting": [[ 0, "desc" ]],
"bStateSave": true,
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var settings = this.fnSettings();
var str = settings.oPreviousSearch.sSearch;
$('td', nRow).each( function (i) {
this.innerHTML = aData[i].replace( str, ''+str+'' );
} );
return nRow;
}
} );
[/code]
Reload Datatable:
[code]
oTable.fnClearTable(0);
oTable.fnAddData(data);
oTable.fnDraw();
[/code]
Simple code for load DataTable:
[code]
oTable = $('#rss_source').dataTable( {
"sPaginationType": "full_numbers",
"bProcessing": true,
"sAjaxSource": "/admin/load_data/load_rss_sources",
"aaSorting": [[ 0, "desc" ]],
"bStateSave": true,
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var settings = this.fnSettings();
var str = settings.oPreviousSearch.sSearch;
$('td', nRow).each( function (i) {
this.innerHTML = aData[i].replace( str, ''+str+'' );
} );
return nRow;
}
} );
[/code]
Reload Datatable:
[code]
oTable.fnClearTable(0);
oTable.fnAddData(data);
oTable.fnDraw();
[/code]
This discussion has been closed.