Save custom information on datatable state

Save custom information on datatable state

Cronos89Cronos89 Posts: 1Questions: 1Answers: 0

Hi everyone,
it's possible to save custom attribute in save state?
I need to know if the user voluntary change the visibility of a column.
I manage how to add a field in state, but when i reload the page the field is gone.

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi Cronos89,

    Yep, you can add your attributes to the set by having stateSaveParams and stateLoadParams customisations, as in this example. Here, if you type anything into the input element, then reorder a column (to force a save), when you reload the page that input value will return.

    Hope that helps,

    Cheers,

    Colin

This discussion has been closed.