Remove the local stored data form a table
Remove the local stored data form a table

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
This discussion has been closed.
Answers
You can use the
state.clear()
API to clear the storage.Kevin
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();
}
}