DataGrid 加checkbox
来源:互联网 发布:suse linux 开放端口 编辑:程序博客网 时间:2024/06/07 23:03
<?xml version="1.0" encoding="utf-8"?><ns:MDIWindow xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" xmlns:ns="http://code.google.com/p/flexlib/" x="0" y="0" creationComplete="mdiwindow1_creationCompleteHandler(event)" ><fx:Script><![CDATA[import com.fms.xx.calculate.dbManager.event.DbManagerEvent;import mx.collections.ArrayCollection;import mx.controls.dataGridClasses.DataGridColumn;import mx.events.FlexEvent;import valueObjects.ColumnInfo;[Bindable]public var colums:ArrayCollection = new ArrayCollection();public var selected:Boolean = false;protected function commit_tableInfo_id_clickHandler(event:MouseEvent):void{this.dispatchEvent(new DbManagerEvent(DbManagerEvent.COMMINT_TABLEINFO));}protected function mdiwindow1_creationCompleteHandler(event:FlexEvent):void{for each(var col:Object in colums){var dgc:DataGridColumn = new DataGridColumn();dgc.headerText = col.columnName;dgc.dataField = ""+col.columnName+"";dgc.width = 70;dg_id.columns = dg_id.columns.concat(dgc);}}]]></fx:Script><fx:Declarations><!-- 将非可视元素(例如服务、值对象)放在此处 --></fx:Declarations><!--<mx:VBox verticalScrollPolicy="off" maxWidth="900" height="100%">--><mx:DataGrid id="dg_id" maxWidth="{commit_columInfo_id.width}" width="{commit_columInfo_id.width}" height="100%" editable="true" dataProvider="{colums}" horizontalScrollPolicy="auto" verticalScrollPolicy="auto" textAlign="center" ><mx:columns><mx:DataGridColumn width="50" editable="false"> <mx:itemRenderer > <fx:Component> <mx:VBox horizontalAlign="center"><mx:CheckBox selected="{data.selected}" change="checkbox1_changeHandler(event)"> <fx:Script> <![CDATA[ protected function checkbox1_changeHandler(event:Event):void {//将复选框的状态保存在obj中,防止出现复选框错乱的情况 this.outerDocument.colums.getItemAt(this.outerDocument.colums.getItemIndex(this.outerDocument.dg_id.selectedItem)).selected=event.target.selected;} ]]> </fx:Script> </mx:CheckBox> </mx:VBox></fx:Component> </mx:itemRenderer> </mx:DataGridColumn> </mx:columns></mx:DataGrid><s:Button id="commit_columInfo_id" width="100%" height="5%" label="保存修改" /><!--</mx:VBox>--></ns:MDIWindow>
运行效果:
0 0
- DataGrid 加checkbox
- DataGrid加 CheckBox在线等待
- datagrid加checkbox实现分页不丢失选择的记录
- datagrid加checkbox实现分页不丢失选择的记录
- 在绑定控件中(datagrid,gridview..)加checkbox
- datagrid checkbox
- datagrid + checkbox
- datagrid 列头加txtbox并动态赋值,列为checkbox赋值二法,datagrid用DIV动态加滚动条。
- datagrid加checkbox实现分页不丢失选择的记录 (转)
- 给DataGrid加CheckBox列并在表头添加全选、全选按钮、置零按钮
- 给DataGrid加CheckBox列并在表头添加全选、全选按钮、置零按钮
- Datagrid中的checkbox
- DataGrid中添加CheckBox
- datagrid中checkbox全选
- DataGrid中的CheckBox处理
- DataGrid Bind Checkbox....
- CheckBox 过滤 DataGrid 显示
- datagrid,checkbox混合使用
- "=="和equals方法究竟有什么区别?
- UVA - 301 Transportation (回溯)
- 【HNOI(P) 2014】总结
- 人生是场马拉松
- 排序算法(1)——快速排序
- DataGrid 加checkbox
- hdu 2048
- HDU 2256 Problem of Precision(矩阵快速幂入门题)
- hd1863畅通工程
- 数据海量小文件的存储的问题
- 在win7下面清除samba用户的登录状态
- 使用NSAssert
- HDU1231最长连续子序列(最简单的DP)
- Java读取文件方法