State Save to MySQL with state.clear()
State Save to MySQL with state.clear()
lenamtl
Posts: 265Questions: 65Answers: 1
Hi,
I'm adapting this script to save Datatables State to MySQL.
http://refreshmymind.com/datatables-state-save-client-server-side/
(see the last article)
I'm looking for a way to reset the table preferences, I have tried state.clear() on a button with no luck when state is saved to MySQL. ( state.clear() on a button work ok when using localstorage )
Any help is appreciated
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You'd need to send an ajax request to the server, requesting that it delete the saved state. That isn't something that the client-side API will help with I'm afraid.
Allan
ok that's what I thought...
I will try the following: delete the state then reload the page.
Update
Just to mention that the state-clear is working fine no need to delete it from DB.
As when the user click to clear the state, then the values get saved in the DB...