infinite-tree icon indicating copy to clipboard operation
infinite-tree copied to clipboard

How can I specify if a node should be expanded or collapsed on load?

Open alesce opened this issue 6 years ago • 1 comments

When I reload the tree data I would like to keep the same nodes expanded/collapsed if they still exist.

Currently I can't find any option to do so. Am I missing something?

Regard, Aleš

alesce avatar Sep 17 '18 14:09 alesce

I had to do something similar. Each node you create in your data, has two important entries, the children and the state. The first tells the library what are the nodes under the current node. And the second is the state of the node. In the state, you can define state.open. When true, it will be expanded.

kinow avatar Jan 28 '20 23:01 kinow