DataGrid 동적으로 데이타 바인딩 - 1

Programming/Flex 2007.08.07 16:25 Posted by 파란크리스마스

xmldata.xml

<?xml version="1.0" encoding="iso-8859-1"?>
<root>
  <msg>ok</msg>
  <pagemax>20</pagemax>
  <pageinx>1</pageinx>
  <data>
    <row>
      <aaa>1</aaa>
      <bbb>a</bbb>
    </row>
    <row>
      <aaa>2</aaa>
      <bbb>b</bbb>
    </row>
    <row>
      <aaa>3</aaa>
      <bbb>b</bbb>
    </row>
  </data>
</root>

borad2.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
 creationComplete="xmlData1.send()">

 <mx:HTTPService id="xmlData1" url="http://localhost:8080/examples/xmldata.xml"/>

 <mx:DataGrid x="233" y="177" dataProvider="{xmlData1.lastResult.root.data.row}" width="457">
  <mx:columns>
   <mx:DataGridColumn headerText="Column 2" dataField="bbb"/>  
   <mx:DataGridColumn headerText="Column 1" dataField="aaa"/>
  </mx:columns>
 </mx:DataGrid>
 
</mx:Application>

신고


 

티스토리 툴바