把XML转换ArrayCollection 帮定数据
acItembydrink.removeAll();
for each(var xml:XML in obj.data.row){
var temp:* = {};
for(var key:String in fields){
temp[key+'Col'] = xml[key];
}
acItembydrink.addItem(temp);
}
<mx:DataGrid id="dgDrink" dataProvider="{acItembydrink}">
直接帮定XML数据
this.xmlData=XML(e.data);
<mx:DataGrid id="dgContainer" dataProvider="{xmlData.row}">
XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<response>
<data>
<row>
<id_pol>1</id_pol>
<name_pol>name 1</name_pol>
</row>
<row>
<id_pol>2</id_pol>
<name_pol>name 2</name_pol>
</row>
</data>
<metadata>
<totalRows>345</totalRows>
<pageNum>1</pageNum>
</metadata>
</response>