AdvancedDataGrid 的节点对象怎么读取?
<?xml version= "1.0 " encoding= "utf-8 "?>
<mx:Application xmlns:mx= "http://www.adobe.com/2006/mxml " layout= "absolute " fontSize= "12 ">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
import mx.controls.Alert;
//目录点击跳转函数
private function ADGClick_fun(e:ListEvent):void{
Alert.show(e.currentTarget.selectedItem);
}
]]>
</mx:Script>
<mx:XMLList id= "myXMLList ">
<friends a= "00 " b= "可以读取 " >
<friend a= "01 " b= "这个节点怎么读取 "/>
<friend a= "02 " b= "这个节点怎么读取 "/>
<friend a= "03 " b= "这个节点怎么读取 "/>
</friends>
<families a= "04 " b= "可以读取 ">
<friend a= "05 " b= "这个节点怎么读取 "/>
<friend a= "06 " b= "这个节点怎么读取 "/>
<friend a= "07 " b= "这个节点怎么读取 "/>
<families a= "08 " b= "可以读取 ">
<friend a= "09 " b= "这个节点怎么读取 "/>
<friend a= "10 " b= "这个节点怎么读取 "/>
<friend a= "11 " b= "这个节点怎么读取 "/>
</families>
</families>
</mx:XMLList>
<mx:HierarchicalData source= "{myXMLList} " id= "myHD "/>
<mx:AdvancedDataGrid id= "myADG " dataProvider= "{myHD} " itemClick= "ADGClick_fun(event); " width= "100% " height= "100% " openDuration= "0 " draggableColumns= "false " sortableColumns= "false " sortExpertMode= "true " rowHeight= "22 " creationComplete= " myADG.expandAll(); ">
<mx:columns>
<mx:AdvancedDataGridColumn headerText= "A " dataField= "@a " sortable= "false "/>
<mx:AdvancedDataGridColumn headerText= "B " dataField= "@b " sortable= "false "/>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Application>
[解决办法]
var temp:XML = event.currentTarget.selectedItem
Alert.show(temp.attribute("a"));