maintain page number on reload datatables code example
Example 1: ajax datatable reload paging retained
table.ajax.reload(null, false)
Example 2: how to go back to the same page in data table after refreshing
$(document).ready(function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables', JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
return JSON.parse( localStorage.getItem('DataTables') );
}
} );
} );