Remove the local stored data form a table

Remove the local stored data form a table

bfarkasbfarkas Posts: 181Questions: 48Answers: 0

Hi,
I am doing a setup like found here:
https://editor.datatables.net/examples/advanced/localstorage.html

The one problem/question I am trying to figure out how to solve is the data pretty much lives in local storage permanently for the short term. Clearing cache doesn't wipe it, or anything. I was thinking of some sort of button to delete current local storage but not sure how to go about it.
Thoughts?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923
    Answer ✓

    You can use the state.clear() API to clear the storage.

    Kevin

  • bfarkasbfarkas Posts: 181Questions: 48Answers: 0

    Went with a more direct function for the clear as the other was not clearing all the time:

    {
    extend: "create",
    editor: p200editor,
    text: 'Purge',
    action: function () {
    window.localStorage.clear();
    window.location.reload();
    }
    }

This discussion has been closed.