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

pravin_lipnepravin_lipne Posts: 4Questions: 2Answers: 0

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

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    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

  • pravin_lipnepravin_lipne Posts: 4Questions: 2Answers: 0

    Thanks Allan for quick response..

This discussion has been closed.