0

Filter on a Tree

asked 2016-01-22 18:05:07 +0800

sbasly gravatar image sbasly
3 1

I'm, implementing a Tree using ZK Richlet

mainTree = new Tree(); mainTreeModel = new AdvancedTreeModel((new TreeExplorerGeneratorZK(baProject, true)).getRoot()); mainTree.setItemRenderer(new TreeRenderer()); mainTree.setModel(mainTreeModel);

and that's work fine for me. right now i want to add a textBox and I wan't to make it act like a filter. when I write text on the textBox I want to disable or make invisible all the leaf that they don't contains the textBox value.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-01-26 09:28:17 +0800

Darksu gravatar image Darksu
1991 1 4

Hello sbasly,

First of all you should check out an example with the OnChanging event for a textbox:

https://www.zkoss.org/zkdemo/event/onChanging_event

After that you could modify your code to filter out the model data. A similar example with listbox can be found below:

http://zkfiddle.org/sample/2un9vk5/6-search-and-filter-by-MVVM#source-2

Don't forget to add the NotifyChange for the model!

Also you could check this small talk:

http://books.zkoss.org/wiki/SmallTalks/2007/August/ZKTree_Model

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-01-22 18:05:07 +0800

Seen: 29 times

Last updated: Jan 26 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More