65
Views
1
Comments
Solved
[zTree] Expand and collapse with Ztree
Question
ztree
Web icon
Forge asset by Eduardo Luís

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!

2022-06-17 09-22-26
Huarlem Lima
Solution

Hello Eduardo,

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.