i'm doing a project where i can search a node withing my treeView my code so far is this:
function expandAllAncestors(node) {
if (node.get_expanded() !== true)
node.expand();
if (node.get_level() != 0) {
expandAllAncestors(node.get_parent());
}
}
function SearchClick() {
var search = $get("<%= ApplicationSearchResult.ClientID %>").value;
var treeView = $find("<%= MainTree.ClientID %>");
var nodes = treeView.get_allNodes();
var NextNode = document.getElementById("<%=NextNode.ClientID %>");
NextNode.style.display = "block";
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.get_text() == search) {
node.set_selected(true);
expandAllAncestors(node);
ret ...
Go to the complete details ...