How to enable state saving on button click, but not on page load

How to enable state saving on button click, but not on page load

amitywebamityweb Posts: 5Questions: 3Answers: 0

I have the same issue as this unanswered thread http://www.datatables.net/forums/discussion/24206/how-to-enable-state-saving-on-button-click

I would like to save the state to a database when a button is clicked. I have this process working by assigning table.state.save(); to a click event, which then calls stateSaveCallback. The big problem is, stateSaveCallback is also called on page load. So everytime the page is refreshed (which I have to do after calling table.state.save) it saves the state again.

How does one stop saving the state on page load, and just save the state on button click?

Thanks

This discussion has been closed.