14
Views
5
Comments
Solved
[GTree] Is there a way for the list to not refresh after collapsing/expanding?
gtree
Reactive icon
Forge asset by Pedro Neto
Application Type
Reactive

My use case is to ensure that when I click on a child node, that child node remains highlighted, even when I collapse or expand other categories. However, I noticed that collapsing/expanding categories basically refreshes the list. As a result, my custom class disappears. I have a Javascript to add my custom class in the GTreeOnClickNodeLink

I also tried without the Javascript route, by targetting the IsHighlight property in GTreeOnClickNodeLink. While the highlight of the child node is present, the entire tree collapses (which is something I do not want). I think the codebase of GTree collapses the tree whenever any of the properties of the nodes are updated. I need the tree's structure to remain as it is no matter whether the IsHighlight is updated

How do I achieve my requirement?

GTree_Test.oml
2023-10-16 05-50-48
Shingo Lam
Solution

Hi @Rupali Roy Choudhury ,

I think it is behavior of the component already. You to raise the enhancement request to the support team to change this.

For the workaround, you are on right track to do the js to update the css class to rehighlight. I just edit your solution to let it work correctly. Please check the attach oml, refer to the Onready and CheckSelected

GTree_Test.oml
UserImage.jpg
Rupali Roy Choudhury

This works :) Exactly what I am looking for

2023-10-16 05-50-48
Shingo Lam

nice that it helps you.

you can change the timeout milliseconds if the UI is a bit lagging 

2019-12-01 23-50-25
Pedro Neto
Champion

Hi Rupali,

Thanks for sharing your use case.

I've attached a video. Is this the functionality you are looking for ?

Recording 2026-01-15 125344.mp4
UserImage.jpg
Rupali Roy Choudhury

Hello @Pedro Neto Thank you for sharing the video. 

You have clicked "Node name 2", "Node name 3", "Node name 4". Now can you click on the icon of "Node name 5"? You will notice that the highlight from the previously selected node will disappear (which is something I don't want). To elaborate, if I select "Node name 4", and then I expand the "Node name 5" by clicking the icon beside it, I notice that the highlight from "Node name 4" disappears. I need the highlight from the "Node name 4" to remain

Looking forward to your response

2023-10-16 05-50-48
Shingo Lam
Solution

Hi @Rupali Roy Choudhury ,

I think it is behavior of the component already. You to raise the enhancement request to the support team to change this.

For the workaround, you are on right track to do the js to update the css class to rehighlight. I just edit your solution to let it work correctly. Please check the attach oml, refer to the Onready and CheckSelected

GTree_Test.oml
UserImage.jpg
Rupali Roy Choudhury

This works :) Exactly what I am looking for

2023-10-16 05-50-48
Shingo Lam

nice that it helps you.

you can change the timeout milliseconds if the UI is a bit lagging 

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