D
D
Dolios2011-09-18 15:18:24
ExtJS/Sencha
Dolios, 2011-09-18 15:18:24

ExtJS 4 TreePanel hiding nodes?

Hello. Tell me who knows, I'm fighting the second day, I've already read everything that is possible.
We have TreePanel and textfield.
When the user enters something into the text field, the tree should be filtered and only those nodes whose names contain the entered text should be visible.
A similar situation with the grid was solved simply - by filtering the store. But TreeStore doesn't have a filter method. How to hide the node - also did not find. I found several solutions on the net, but they were all for ExtJS 3. The
question is actually how to filter the TreeStore on the client or how to hide the tree node (I'll filter it myself then). It seems that I am fantastically stupid, the task should be solved in some simple and understandable way.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TheHorse, 2011-09-18
@TheHorse

This is not a very simple operation, it is not clear what to do with child nodes if the root is filtered out. But in any case, the ExtJS4 API says that Ext.data.TreeStore has filters in its configs. If for some reason it doesn't work for you, you can always just traverse the tree recursively and hide/show whatever you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question