How do I trigger a state load on click

How do I trigger a state load on click

nathan.khupenathan.khupe Posts: 5Questions: 2Answers: 0

I have setup stateSaveCallback and stateLoadCallback they are working. I can trigger a state save onclick using datatable.state.save(bool) but I can't find how to apply the newly loaded statae from my db. How do I trigger a state load as required and apply them to the table

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    The table assumes the saved state wouldn't change, without its involvement. So if it is being changed, you would need to reinitialise the table.

    Colin

  • nathan.khupenathan.khupe Posts: 5Questions: 2Answers: 0
    edited November 2020

    Re-initialising the table seems like a dirty solution, but it gets the job done :). Particularly because my initialization configuration is quite long.
    Thanks Colin

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    If you know what's changing in the state, say for example only column searches or ordering perhaps, you could apply those changes by hand via the API. It might be an alternative solution,

    Colin

This discussion has been closed.