mbraak / jqTree

Tree widget for jQuery
https://mbraak.github.io/jqTree/
Apache License 2.0
1.02k stars 177 forks source link

Save state for a dynamically Loaded tree #273

Closed ghost closed 9 years ago

ghost commented 10 years ago

Hi everyone, I am trying to savestate of the tree in localstorage.The example shown in the demo for savestate function uses the entire data loaded at once.However, i am loading the data on demand using the ajax calls and save state is not working for it.

Suggest any idea for it

mbraak commented 10 years ago

I have the same problem. My solution is to save only the selected tree node.

The solution is implemented in django-mptt-admin.

Greetings, Marco

ghost commented 10 years ago

cant you store the initial json data and then keep on updating it everytime there is a change in it like adiing nodes on ajax calls... and then use this json data next time to generate the tree structure

mbraak commented 10 years ago

I think that's possible in theory. However, it's difficult to implement. Also I think it maybe too slow.

mbraak commented 9 years ago

This is now fixed in the dev branch. The saveState option should work automatically for nodes that are loaded on demand.