dabeng / OrgChart

It's a simple and direct organization chart plugin. Anytime you want a tree-like chart, you can turn to OrgChart.
MIT License
2.87k stars 770 forks source link

Cache the orgchart state #386

Open Almo7aya opened 6 years ago

Almo7aya commented 6 years ago

Hello, What if i want to cache the current state of the orgchart to the next reload, like if i collapsed some nodes i want in the next visite the orgchart be with collapsed nodes.

avallete commented 6 years ago

Look like you have an example in the demos:

https://github.com/dabeng/OrgChart/blob/master/demo/default-collapsed.html

So, simply add the 'collapsed' property to 'true' on the node that you want to be collapsed by default.

sahadat84 commented 6 years ago

But is there any onCollapsed event that return node info like {id, collapsed, etc...?} I think @Almo7aya is talking about that not just want to be collapsed by default but catch current state of chart after many expend or collapsed done by user.

I am sure there must be, Its a question of how and/or if there is any sample example?