jstree - one tree in different pages

178 views Asked by At

i have a short question for the jstree (jstree.com)

I would use one instance of the tree in different pages an save the current tree status with the "stage property"

For example. I have the follow pages which have there own content.

index.htm example1.htm example2.htm impressum.htm

Now i would build the navigation with the jstree. When i click at a link the called page open and i can use the "same" jstree instance. But i will not define a new tree in each site. Is this possible?

Thank you

Felix

1

There are 1 answers

0
vakata On BEST ANSWER

Move all common code to a script file and include it on each of the pages. Also make sure you enable the state plugin (in your jstree config) as it will persist opened/selected nodes across reloads.