State Save to MySQL with state.clear()

State Save to MySQL with state.clear()

lenamtllenamtl 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

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    Answer ✓

    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

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1
    edited May 2017

    ok that's what I thought...

    I will try the following: delete the state then reload the page.

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1

    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...

This discussion has been closed.