如何在flex数据网格中显示以下xml

时间:2010-06-09 13:34:49

标签: flex

<rows>
−
<row rowno="1">
−
<row-value>
<colno>1</colno>
<value>1</value>
</row-value>
−
<row-value>
<colno>2</colno>
<value>sel</value>
</row-value>
−
<row-value>
<colno>3</colno>
<value>select * from qt_query</value>
</row-value>
−
<row-value>
<colno>4</colno>
<value>kishore</value>
</row-value>
−
<row-value>
<colno>5</colno>
<value>2009-04-10 00:00:00.0</value>
</row-value>
−
<row-value>
<colno>6</colno>
</row-value>
−
<row-value>
<colno>7</colno>
</row-value>
</row>
−
<row rowno="2">
−
<row-value>
<colno>1</colno>
<value>2</value>
</row-value>
−
<row-value>
<colno>2</colno>
<value>sel12345</value>
</row-value>
−
<row-value>
<colno>3</colno>
<value>select * from qt_query</value>
</row-value>
−
<row-value>
<colno>4</colno>
<value>kishore</value>
</row-value>
−
<row-value>
<colno>5</colno>
<value>2009-04-10 00:00:00.0</value>
</row-value>
−
<row-value>
<colno>6</colno>
<value>krajkumard</value>
</row-value>
−
<row-value>
<colno>7</colno>
<value>2010-05-21 00:00:00.0</value>
</row-value>
</row>
−
<row rowno="3">
−
<row-value>
<colno>1</colno>
<value>3</value>
</row-value>
−
<row-value>
<colno>2</colno>
<value>sele123</value>
</row-value>
−
<row-value>
<colno>3</colno>
−
<value>
select * from cache where %2scache_name% = ? and %1icache_type% = ?
</value>
</row-value>
−
<row-value>
<colno>4</colno>
<value>krajkumard</value>
</row-value>
−
<row-value>
<colno>5</colno>
<value>2010-05-21 00:00:00.0</value>
</row-value>
−
<row-value>
<colno>6</colno>
</row-value>
−
<row-value>
<colno>7</colno>
</row-value>
</row>
−
<row rowno="4">
−
<row-value>
<colno>1</colno>
<value>4</value>
</row-value>
−
<row-value>
<colno>2</colno>
<value>upd</value>
</row-value>
−
<row-value>
<colno>3</colno>
<value>select * from qt_qtool where %sname=?%</value>
</row-value>
−
<row-value>
<colno>4</colno>
<value>krajkumard</value>
</row-value>
−
<row-value>
<colno>5</colno>
<value>2010-05-31 00:00:00.0</value>
</row-value>
−
<row-value>
<colno>6</colno>
</row-value>
−
<row-value>
<colno>7</colno>
<value>2010-06-07 00:00:00.0</value>
</row-value>
</row>
−
<row rowno="5">
−
<row-value>
<colno>1</colno>
<value>5</value>
</row-value>
−
<row-value>
<colno>2</colno>
<value>Pron_errors</value>
</row-value>
−
<row-value>
<colno>3</colno>
<value>select * from proanalyzer_errors</value>
</row-value>
−
<row-value>
<colno>4</colno>
<value>tjothy</value>
</row-value>
−
<row-value>
<colno>5</colno>
<value>2010-06-07 00:00:00.0</value>
</row-value>
−
<row-value>
<colno>6</colno>
</row-value>
−
<row-value>
<colno>7</colno>
</row-value>
</row>
</rows>

1 个答案:

答案 0 :(得分:0)

<mx:DataGrid dataProvider="{yourXml}"
 <mx:columns>
   <mx:Array> 
    <mx:DataGridColumn columnName="colno" headerText="Column Number" />
    <mx:DataGridColumn columnName="value" headerText="Value" />
   </mx:Array>
 </mx:columns> 
</mx:DataGrid>

参见,例如:http://www.bpurcell.org/blog/index.cfm?mode=entry&entry=1020