1 Reply Latest reply on Dec 12, 2007 11:23 AM by ntsiii

    How do you get edited node label or attributes

    kiwibloke Level 1
      Hi,

      I have a tree that has editable="true"

      This enables me to edit the lable of a node in my tree.

      How do you get the new label value from a node that has just been edited? I want to return only this to my database along with the id of the node that was edited.

      I think this involves two things:
      1. How do you identify / interact with the node you have just edited? eg: Get it's id?
      2. How do you get the new attributes values for that node? eg: Get its label value?

      All help greatly appreciated!
      Thanks
        • 1. Re: How do you get edited node label or attributes
          ntsiii Level 3
          If you have edited the node, then it is selected, so you can get a reference to it using:
          myTree.selectedItem;

          How you access the properties depends on what the node item data type is. If xml, then use xml properties and methods like @label.

          tip, selectedItem is always an object. You should cast/convert it into the actual item datatype:
          var xmlNodeSelected:XML = XML(myTree.selectedItem);

          Tracy