I would like to make the tree view for the account records. So, I have used the Dynatree to making the tree view. It is work fine. Now I owuld like to impletement the search feature.
How to make the Dynatree filter in Visulforce page using javascript.
I want to rearrange the tree by searching from the textfield.
I found the follwoing code for the filter but I dont knwo how to use this. Please let me know where should we use below the code.
Code Snippet:
DynaTreeNode.prototype.search = function(pattern){
if(pattern.length < 1 && !clear){
clear = true;
this.visit(function(node){
node.expand(true);
node.li.hidden = false;
node.expand(false);
});
} else if (pattern.length >= 1) {
clear = false;
this.visit(function(node){
node.expand(true);
node.li.hidden = false;
});
for (var i = 0; i < this.childList.length; i++){
var hide = {hide: false};
this.childList[i]._searchNode(pattern, hide);
}
}
},