datatables stay on page after reload code example
Example 1: ajax datatable reload paging retained
// table.ajax.reload(callback, resetPaging)
table.ajax.reload(null, false)
Example 2: datatables keep order and page selection page refresh
$('#offersTable').dataTable({
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem('offersDataTables', JSON.stringify(oData));
},
"fnStateLoad": function (oSettings) {
return JSON.parse(localStorage.getItem('offersDataTables'));
}
});