I am using extjs in my application. I have created the treeview and I want to implement advance search in tree view. When I type letter in textbox it search in last level childes of treeview without expanding the tree view and if search fulfil then make node visible otherwise hide that node. Currently it search only in root level nodes.
It can not search in childes of tree until we expand the tree view.
Please help me.
What I have tried:
onLibraryFilterChange: function(b) {
var a = b.getValue() ? b.getValue().toLowerCase().trim() : "";
this.getLibraryTree().getRootNode().cascadeBy(function(f) {
var g = f.data.name ? f.data.name.toLowerCase() : "";
if (f.data.type === "song") {
if (f.data.title && f.data.title.length > 0) {
g = f.data.title.toLowerCase()
}
if (f.data.artist && f.data.artist.length > 0) {
g += " " + f.data.artist.toLowerCase()
}
}
var e = this.getView().getNodeByRecord(f);
var d;
var c;
if (f.parentNode) {
d = this.getView().getNodeByRecord(f.parentNode);
if (f.parentNode.parentNode) {
c = this.getView().getNodeByRecord(f.parentNode.parentNode)
}
}
if (e) {
if (g.indexOf(a) == -1) {
e.hidden = true
} else {
e.hidden = false;
if (d) {
d.hidden = false
}
if (c) {
c.hidden = false
}
}
}
}, this.getLibraryTree())
}