5 Replies Latest reply on Apr 27, 2006 3:53 AM by bluesquid

    Tree Componet Help

    bluesquid Level 1
      Hi,

      Is there any way to open nodes in a tree component through scripting.It should work just like when we use arrow keys and tab to traverse through the tree.

      Please help,
        • 1. Re: Tree Componet Help
          Arul Prasad
          doesnt .setIsOpen() method help?
          • 2. Re: Tree Componet Help
            bluesquid Level 1
            Hi Arul,

            Thanks.setIsOpen() does open the nodes.But I have a little complex task on hand.I will tell you what it is.

            I Have a course which is having index search , book mark etc.The tree structure is my main navigation though. If the user uses the index search to go to a particular topic...the tree should reflect it. Meaning u may have to open a few nodes to get to the content.Some 3 levels inside. I am trying with setIsOpen()..But failed till now to get to the chiled nodes. What I am trying is to search the full tree data , find the correct node . then find the index of that node...then open it .Is that the best way or is there any short arm jab ...?
            Like to hear from you, I am working in a company where you were once...
            • 3. Re: Tree Componet Help
              Arul Prasad Level 1
              Alright,

              here is the complete code to do what you want: Please follow the instructions i've put in the comments on top:
              • 4. Tree Componet Help
                Arul Prasad Level 1
                forgot to mention, have a button on stage with instance name _btn as well.

                once the XML loads, click the button to have the node open.

                Basically you will have to traverse thru the tree to find each node's parent and open that as well.
                Hope it helps.

                ~Arul Prasad.
                • 5. Re: Tree Componet Help
                  bluesquid Level 1
                  Hi arul,
                  Thanks for that code. I am able to open the nodes.But my worry is the module structure; It is something like this;
                  ------------------
                  <node label="3">
                  <node label="3.1">
                  <node label="3.1.1">
                  <node label="3.1.1.1" />
                  </node>
                  </node>
                  </node>
                  ------------------
                  And i have to make 3.1.1.1 as the selected index!. There are lots of main nodes present too. But I succeeded till there.Thanks.

                  Now I have another issue; the scroll bar in the tree is not changing if I edit the scroll bar assets.Why? is it built in the tree?.
                  Please tell me.
                  Thanks,