flex中使用DataGrid显示xml
时间:2010-10-09 来源:fsl
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" creationComplete="bookDate.send()">
<mx:HTTPService id="bookDate" url="huiyuan.xml" />
<mx:DataGrid width="825.5" height="377" dataProvider="{bookDate.lastResult.NewDataSet.NewView}" enabled="true"> <mx:columns> <mx:DataGridColumn headerText="序列号" dataField="id" width="100"/> <mx:DataGridColumn headerText="姓名" dataField="name"/> <mx:DataGridColumn headerText="电话" dataField="phone"/> <mx:DataGridColumn headerText="邮件" dataField="mail"/> </mx:columns> </mx:DataGrid> <mx:Style source="fcss.css"/> </mx:Application>
<mx:DataGrid width="825.5" height="377" dataProvider="{bookDate.lastResult.NewDataSet.NewView}" enabled="true"> <mx:columns> <mx:DataGridColumn headerText="序列号" dataField="id" width="100"/> <mx:DataGridColumn headerText="姓名" dataField="name"/> <mx:DataGridColumn headerText="电话" dataField="phone"/> <mx:DataGridColumn headerText="邮件" dataField="mail"/> </mx:columns> </mx:DataGrid> <mx:Style source="fcss.css"/> </mx:Application>
xml数据文件格式
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<NewView>
<id>4804</id>
<name>韩xx</name>
<mail>[email protected]</mail>
<phone>zz226280</phone>
</NewView>
<NewView>
<id>4802</id>
<name>吴ss</name>
<mail>[email protected]</mail>
<phone>13062121dfd8</phone>
</NewView>
</NewDataSet>
相关阅读 更多 +