Saving state od daterange in localstorage doesn't work
Saving state od daterange in localstorage doesn't work
azomix
Posts: 1Questions: 0Answers: 0
Hello,
I'm pretty new to datatables and I'm trying to store my filters in localstorage.
It works pretty well for all fields except date-range fields.
[code]
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables_'+window.location.pathname, JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
return JSON.parse( localStorage.getItem('DataTables_'+window.location.pathname) );
}
[/code]
Is it because JSON.stringify is not able to serialize a date object ?
Thanks for your help.
I'm pretty new to datatables and I'm trying to store my filters in localstorage.
It works pretty well for all fields except date-range fields.
[code]
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables_'+window.location.pathname, JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
return JSON.parse( localStorage.getItem('DataTables_'+window.location.pathname) );
}
[/code]
Is it because JSON.stringify is not able to serialize a date object ?
Thanks for your help.
This discussion has been closed.