expand Node and all its parents On Client side

1 posts, 0 answers
  1. woody
    woody avatar
    12 posts
    Member since:
    Sep 2006

    Posted 09 Sep 2009 Link to this post

    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
Back to Top