20
Views
5
Comments
Solved
[GTree] For the search, I need the search to be activated on every input by the user
Question
gtree
Reactive icon
Forge asset by Pedro Neto
Application Type
Reactive

When I search for a node name, I need the search to be activated on every input the user keys in. While GTree implements in the handler of onkeydown, I was hoping the "JSCheckIfEnter" condition was not present. For me just the "FilterTreeAction" action inside the onkeydown handler is enough.

Will the GTree team implement this feature? If yes, when can I expect a release?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Rupali,

I've just uploaded a new version of GTree, that allows you to specify whether pressing Enter is needed or not for filtering. You can also set the minimum number of characters before filtering is active (e.g. to avoid filtering after a single character in a large tree, which would be very slow). I hope this helps your use case!

UserImage.jpg
Rupali Roy Choudhury

For now, I am just using a workaround to stimulate a click after ever type (using keyup event) on the search input. But it will be better if this control is provided by the component itself

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

Its good temporary approach. But if the data is huge, we cannot trigger the search on every key down which will cause the performance issue.

Actually, its better if the team can provide the option that we can turn on/off to let it auto trigger or not

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Note that it's easy to modify GTree to behave like this. I've added two attributes to the FilterSettings structure, FilterAfterEnterOnly (default True) and FilterMinimumCharacters (default 3), and changed the logic in Input_NodeNameOnKeydown to check for FilterAfterEnterOnly false in case no Enter has been pressed, and for FilterMinimumCharacters to see if the number of characters has been reached before we filter.

EDIT: That didn't quite work, so I've now added een OnChange that does the filtering if Enter is not pressed.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I've requested to join the GTree team, so I my changes above can be incorporated.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Rupali,

I've just uploaded a new version of GTree, that allows you to specify whether pressing Enter is needed or not for filtering. You can also set the minimum number of characters before filtering is active (e.g. to avoid filtering after a single character in a large tree, which would be very slow). I hope this helps your use case!

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