4 Replies Latest reply on Jan 5, 2008 5:23 AM by lw1001

    Dynamic Tree Control

    evsPeart
      Hi,

      I need to add child's dynamically to the Tree control, how I can do that?

      When the user push click in one button I have to add a new child to the Tree control.

      See code attached...

      Regards,


        • 1. Re: Dynamic Tree Control
          joan_lafferty Adobe Employee
          You can make the dataProvider for your Tree and XMLListCollection from this XMLList like:

          public var xlc1:XMLListCollection = new XMLListCollection(treeData);

          Then, you can use the methods like addItem() and addItemAt() to add new children to the Tree.

          HTH,
          Joan Lafferty
          Flex SDK QA
          • 2. Re: Dynamic Tree Control
            Level 7
            You can make the dataProvider for your Tree and XMLListCollection from this
            XMLList like:

            public var xlc1:XMLListCollection = new XMLListCollection(treeData);

            Then, you can use the methods like addItem() and addItemAt() to add new
            children to the Tree.

            HTH,
            Joan Lafferty
            Flex SDK QA

            • 3. Dynamic Tree Control
              evsPeart Level 1
              Hi, thanks for the answer.

              But if I want to add the child's in a specific position in the Tree control, how I can do that with the XMLListCollection?

              How I can do to know what is the child (the name) in the Tree Control is selected?
              • 4. Re: Dynamic Tree Control
                lw1001 Level 1
                I have the same question, but with regard to the advanced data grid. I'm thinking of trying to use the selectionIndex property of the grid to know what row is selected. I believe there's a selectedItem property as well if you want to work by names (but i woudn't recommend it, unless you know your names will be unique). hope this is some help