Closed zoaina closed 1 year ago
This is custom logic you will have to do on your own - you have the ability to clear the cache (even with the included config options - .filter for example: https://www.jstree.com/api/#/?q=.state&f=$.jstree.defaults.state.filter). Whether you do that can depend on a variable you set, for example - localStorage.setItem('last_page', window.location.toString()), and then compare with the current location - that way you know if this is the same page or not. You can also set the state key to a hash of the current location - that way each page will have its own state.
I can clear state on every loading event using the code below. Does exists a way to clear state only when user navigate between pages but keep state on page reload ?