使用flex控件tree当选中多节点中最里节点时将ta的内容...2
发布网友
发布时间:2023-10-18 23:44
我来回答
共1个回答
热心网友
时间:2024-10-12 12:06
<mx:Script>
<![CDATA[
public function treeChanged(event:Event):void
{
selectedNode=Tree(event.target).selectedItem as XML;
}
]]>
</mx:Script>
<mx:XMLListCollection id="datatree" >
<mx:source>
<mx:XMLList id="ww">
<node label="NO1">
<node label="NO11">
<node label="NO111" bool="true"/>
</node>
<node label="NO22" bool="true"/>
</node>
<node label="NO2">
<node label="NO11">
<node label="NO111" bool="true"/>
</node>
<node label="NO22">
<node label="NO222" bool="true"/>
</node>
</mx:XMLList>
</mx:source>
</mx:XMLListCollection>
<mx:HDividedBox width="100%" height="100%" color="0x323232">
<mx:Tree id="tree" width="50%" height="100%" labelField="@label"
showRoot="false" dataProvider="{datatree}" change="treeChanged(event)"/>
<mx:TextArea height="100%" width="50%" text="Selected Item: {selectedNode.@label}"/>
</mx:HDividedBox>