Fill XML data into Tree and get it back when selected : Tree Data « Components « Flex






Fill XML data into Tree and get it back when selected

Fill XML data into Tree and get it back when selected
      
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

     <mx:XML format="e4x" id="myMenuModel">
          <menu value="Menu">
                <items value="A" data="0">
                    <item value="A1" data="1"/>
                    <item value="A2" data="2" />
                    <item value="A3" data="3" />
                </items>
                <items value="B" data="4">
                    <item value="B1" data="5"/>
                    <item value="B2" data="6" />
                    <item value="B3" data="7" />
                </items>
                <item value="C" data="8" />
                <item value="D" data="9" />
                <item value="E" data="10" />
            </menu>
        </mx:XML>
        <mx:TextArea id="myText" 
                text="{myTree.selectedItem.@value.toString()} : {myTree.selectedItem.@data.toString()}"  
                height="49"/>
        <mx:Tree dataProvider="{myMenuModel}" labelField="@value"   
                width="248" height="260" id="myTree"/>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.XML data for Tree viewXML data for Tree view
2.Reference XML attribute for tree dataReference XML attribute for tree data
3.Set dataProvider for Tree control through xml attributeSet dataProvider for Tree control through xml attribute
4.Using XML data models and use it as data for Tree controlUsing XML data models and use it as data for Tree control
5.Tree data is from XMLListCollectionTree data is from XMLListCollection
6.Use ActionScript to set up the data provider for Tree controlUse ActionScript to set up the data provider for Tree control
7.AdvancedDataGrid with Grouping(A tree table).AdvancedDataGrid with Grouping(A tree table).
8.Tree uses an XMLListCollection object as the data source:Tree uses an XMLListCollection object as the data source:
9.Tree with static dataTree with static data
10.Hierarchical AdvancedDataGrid Tree Column(TreeTable)Hierarchical AdvancedDataGrid Tree Column(TreeTable)
11.Use an XML object and Tree controlUse an XML object and Tree control
12.Tree control and XMLListCollectionTree control and XMLListCollection
13.Build Tree from XMLListCollection
14.Search Tree node is to search XML with XPathSearch Tree node is to search XML with XPath
15.Build a tree out of an XML documentBuild a tree out of an XML document
16.Tree controls uses an XML object directlyTree controls uses an XML object directly
17.Create Tree object from XMLListCreate Tree object from XMLList
18.Tree with static valueTree with static value