用户登录
用户注册

分享至

flex grid

  • 作者: 迷茫居士71979789
  • 来源: 51数据库
  • 2020-09-22
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" fontSize="12" creationComplete="initApp()">
<mx:Script>
<![CDATA[
import mx.events.DragEvent;
import mx.events.DataGridEvent;
internal function initApp():void{
dg.addEventListener(MouseEvent.CLICK,AddHandler);
}
internal function AddHandler(event:Event):void{
tip_txt.text = "你选择:"+dg.selectedItem.name+" and "+dg.selectedItem.author+" and "+dg.selectedItem.date;
}
]]>
</mx:Script>
<mx:Model id="books">
<datas>
<book>
<name>1</name>
<author>A</author>
<date>a</date>
</book>
<book>
<name>2</name>
<author>B</author>
<date>b</date>
</book>
<book>
<name>3</name>
<author>C</author>
<date>c</date>
</book>
</datas>
</mx:Model>
<mx:Label width="100%" color="#004080" text="选择"/>
<mx:DataGrid id="dg" width="100%" height="156" rowCount="5" dataProvider="{books.book}">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="sss"/>
<mx:DataGridColumn dataField="author" headerText="fff"/>
<mx:DataGridColumn dataField="date" headerText="dd" />
</mx:columns>
</mx:DataGrid>
<mx:TextInput id="tip_txt" width="482" height="197"/>

</mx:Application>
软件
前端设计
程序设计
Java相关