DataGrid的用法

注意:遍歷數據主要是依靠提供的dataProvider屬性 

 

<!-- 測試數據 -->
 <mx:XMLList id="employees">
  <employee>
   <name>Christina Coenraets</name>
   <phone>555-219-2270</phone>
  </employee>
  <employee>
   <name>Joanne Wall</name>
   <phone>555-219-2012</phone>
  </employee>
  <employee>
   <name>Maurice Smith</name>
   <phone>555-219-2012</phone>
  </employee>
  <employee>
   <name>Mary Jones</name>
   <phone>555-219-2000</phone>
  </employee>
 </mx:XMLList>

 

 

    <mx:DataGrid x="2.6" y="1" width="98%" height="98%" dataProvider="{employees}" editable="true" borderStyle="none" >
     <mx:columns>
      <mx:DataGridColumn headerText="屬性名稱" dataField="name" editable="false"/>
      <mx:DataGridColumn headerText="屬性值" dataField="phone" editable="true"/>
     </mx:columns>
    </mx:DataGrid>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章