nickperkinslondon / angular-bootstrap-nav-tree

An AngularJS directive that creates a Tree based on a Bootstrap "nav" list.
MIT License
681 stars 301 forks source link

Saving the tree expanded state. #81

Closed vikasgupta1986 closed 5 years ago

vikasgupta1986 commented 9 years ago

Is it possible to save the state of the expanded tree. Lets say i have a page that displays the tree, then i navigate to a different page. I come back to the tree page again, i'd like to keep the tree expanded state.

er-paramjitsaini commented 9 years ago

I also need this type of feature, but on the same page. I am pushing the new tree record data through ajax. Data is properly added into tree but tree is collapse after tree data change. Any help please?

daerogami commented 5 years ago

It might be possible to persist the tree data to session storage, initialize the tree then push the persisted data instead of using the ajax call. Any solution will involve application infrastructure for persistence and re-population.

You will need to save the tree data itself then either re-hydrate the new tree instance with it or programmatically re-expand the branches.

If this is still an issue, re-open and we can discuss alternative solutions.