Use a labelFunction().  In that you have a reference to the item object that is associate with the curent node/row.  If it is an object, yo can dot down, if it is XML then you can use e4x expressions.

 

Actually I can’t tell if you are asking about Tree or DataGrid, but both support labelFunction.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robert Kaeth
Sent: Tuesday, July 25, 2006 6:29 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Creating Tree from XML

 

Hi All,

 

I have following XML and I would like to create a tree out of it.

 

<mx:XMLList id="treeData">
     <node label="RootNode">
         <node label="child1">
             <node label="child11"/>
             <node label="child12"/>
             <node label="child13"/>
         </node>
         <node label="child2">
             <node label="child21"/>
             <node label="child22"/>
             <node label="child23"/>
         </node>
         <node label="child3">
              <node label="child31"/>
             <node label="child32"/>
               <node label="child33"/>
         </node>
      </node> 
  </mx:XMLList>

 

 

The output I want is:

 

RootNode

+-child1

    +--child11

    +--child12

    +--child13

+-child2

    +--child21

    +--child22

    +--child23

+-child3

    +--child31

    +--child32

    +--child33

 

 

I tried the mx:DataGrid, it works fine if the XML is only one level deep but doesn't work otherwise. 

 

In "dataField" attribute of "mx:DataGridColumn" how do I refer to NESTED XML Elements/Attributes.

 

Referring NESTED children using XPath syntax doesn't seem to work.

 

 

TIA

-B

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





YAHOO! GROUPS LINKS




__,_._,___

Reply via email to