Set dataProvider for Tree control through xml attribute : Tree Data « Components « Flex






Set dataProvider for Tree control through xml attribute

Set dataProvider for Tree control through xml attribute
      
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:XMLList id="treeData">
        <node label="File">
            <node label="Save">
                <node label="Doc" />
                <node label="Pdf" />
                <node label="Rdf" />
            </node>
            <node label="Edit">
                <node label="Cut" />
                <node label="Copy" />
                <node label="Paste" />                
            </node>
            <node label="Window" />
            <node label="Help" />
        </node>
    </mx:XMLList>
    <mx:Panel title="Tree Control Example" width="100%">

     <mx:Tree id="myOtherTree" width="100%" labelField="@label"
            dataProvider="{treeData}"
            depthColors="[0xFFCC33, 0xFFCC99, 0xCC9900]"
            alternatingItemColors="['red', 'green']" />
    </mx:Panel>
</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.Using XML data models and use it as data for Tree controlUsing XML data models and use it as data for Tree control
4.Tree data is from XMLListCollectionTree data is from XMLListCollection
5.Use ActionScript to set up the data provider for Tree controlUse ActionScript to set up the data provider for Tree control
6.Fill XML data into Tree and get it back when selectedFill XML data into Tree and get it back when selected
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