OdinaSpb / jstree

Automatically exported from code.google.com/p/jstree
0 stars 0 forks source link

Jstree : save the tree state on refresh and select root on first load. #1006

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use JStree_pre1.0-fix1

I use cookies plugin to save the state of the tree and also I bind "loaded" to 
select the first node(root) when the tree loads first time.
"plugins": ["themes", "json_data", "crrm", "contextmenu", "dnd", "ui", 
"cookies"]

and:

$('#tree').bind("loaded.jstree", function (event, data) {
data.inst.select_node('ul > li:first');
});

Both of them work properly. The only problem is when I refresh the tree both 
the root and the previously selected node are selected which I don't want to 
select root node on refresh. It should be selected only the first time tree 
loads.

Any help would be much appreciated.

Original issue reported on code.google.com by Mprinc...@gmail.com on 30 Jan 2013 at 2:04