5
Views
1
Comments
Solved
[zTree] Expand and collapse with Ztree
Question
Forge component by Eduardo Luís
20
Published on 03 Oct 2019

Hello!

I would like to know if anyone has already implemented or has any idea how to implement the Expand and Collapse configurations in the zTree component.

I know that I can define this through the OPEN property in the zTree structure.

After adding a new node or deleting a node in the tree. I would like to set Open = True, for all my child nodes. With the intention of always leaving the tree open in that position that I made changes.

Does anyone have an easier way of how to implement?

I'm using logic that I have to go through the list several times in order to set the property Open = True. This is getting bigger and bigger.



Thanks!

Rank: #68
Solution

Hello Eduardo,

I believe you can do this using the singlePath method, see an example here.