45
Views
2
Comments
Solved
[zTree] Event button Expand or Collapse zTree
Question
ztree
Web icon
Forge asset by Eduardo Luís

Good afternoon,


I have a part as resolved: https://www.outsystems.com/forums/discussion/66552/save-the-collapse-and-expand-it-in-a-session-variable/

Is there a way to catch the "+" and "-" button event? In the way that it implements, the user will always have to click on the name (node), for my changes to be saved. This is not a legal way for the user. Since he is used to clicking + and - to expand or collapse.

When you click the "+" in the specific node tree, that node will be expanded. When performing or updating (F5) on the page, that node will keep expanded .. until the user selects the "-".



Do you have any idea?

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

Hi Danilo,

In your implementation you are using the onClick event to get the current node, I think that just switching to the onExpand event.


Let me know if that solves it.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Yes,

agree with what Huarlem is saying, you're just focusing on the wrong event, there's onExpand and onCollapse available.

I had a little try, see attached demo

Dorine

twDemoZTree.oml
2022-06-17 09-22-26
Huarlem Lima
Solution

Hi Danilo,

In your implementation you are using the onClick event to get the current node, I think that just switching to the onExpand event.


Let me know if that solves it.

2021-09-06 15-09-53
Dorine Boudry
 
MVP
Solution

Yes,

agree with what Huarlem is saying, you're just focusing on the wrong event, there's onExpand and onCollapse available.

I had a little try, see attached demo

Dorine

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