Tree 默认打开节点

<mx:Tree x="0" y="0" height="100%" width="200"  id="adminTree" showRoot="false"  dataProvider="{treeData}"
labelField="@label" iconField="@icon" itemClick="changeView(event)" 
openItems="{treeData..node}">
</mx:Tree>

<!--定义XMl文件-->
<mx:XMLList id="treeData">
    <node label="Main menu">
        <node label="Access Control" id="2">
            <node label="Accounts" id="1"/>
            <node label="Groups" id="2"/>
            <node label="Policies" id="3"/>
            <node label="permissions" id="4"/>
            <node label="IpBound" id="5"/>
        </node>
    <node label="应用管理" id="1">
            <node label="应用服务器" id="1" icon="serversIcon"/>
            <node label="应用发布" id="2" icon="appsIcon"/>
            <node label="连接审计" id="3" icon="auditIcon"/>
        </node>
        <node label="System Control" id="3">
           <node label="System Configuration" id="1"/>
            <node label="Status" id="2"/>
            <node label="Proxies" id="3"/>
            <node label="AdminLog" id="4"/>
            <node label="Network" id="5"/>
        </node>
</node>
    </mx:XMLList>
   

你可能感兴趣的:(xml)