Monthly Archives: July 2015

Storing the state in a cookie with local storage jQuery Datatables Search, paging and filter ?

$(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’) );
}
} );
} );

Source: http://datatables.net/blog/localStorage_for_state_saving

 

Advertisements