Can we save custom json format with dataTable "Statesave" I only want to save column visibility
Can we save custom json format with dataTable "Statesave" I only want to save column visibility
Currently is is saving as ,
{"time":1424846268069,"start":0,"length":10,"order":[],"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true},"columns":[{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":true,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":false,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":false,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":false,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}},{"visible":false,"search":{"search":"","smart":true,"regex":false,"caseInsensitive":true}}]}
I only want to save "columns"
Answers
You can use
stateSaveParams
to delete the parameters you don't want to be saved. DataTables will check for parameters being present before loading them on state restore, so you should be able to delete any parameters you don't want.Allan
Thanks Allan for quick response..