This is a migrated thread and some comments may be shown as answers.

[Solved] expand Node and all its parents On Client side

0 Answers 101 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
woody
Top achievements
Rank 1
woody asked on 09 Sep 2009, 12:28 PM
i wrote this code in order to expand node and all its parents node

function

PerformSearch()

 

{

 

 

    var tree = $find("MenuTree");

 

 

    var strToSearch = document.getElementById("txtSearchText").value;

 

 

    var node = tree.findNodeByText(strToSearch);

 

 

    var ParentNode=null;

 

 

 

    if(node)

 

    {

        node.highlight();

        node.scrollIntoView();

        ParentNode = node.get_parent();

 

        while (ParentNode != null)

 

            {

                ParentNode.expand();

                ParentNode = node.get_parent();

            }

 

    }

 

 

}


but its run very slowely,
is there another way to perform this action that wont take so long?

p.s. the tree contains 800 nodes

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
woody
Top achievements
Rank 1
Share this question
or