infinite-tree
infinite-tree copied to clipboard
How can I specify if a node should be expanded or collapsed on load?
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š
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.