生成的swf文件在附件里面<?xml version="1.0" encoding="utf-8"?>
<mx:Application initialize="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontFamily="宋体" fontSize="12" width="536" height="396">
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.core.Application;
import mx.controls.dataGridClasses.*;
private var DataGrid1:DataGrid
public var languageFlag:String = "cn";
[Bindable]
public var dataArr2:Array = [{id:1,name:"苹果",price:100,count:"不合格",selected:false},
{id:2,name:"西瓜",price:50,count:"不合格",selected:true},
{id:3,name:"水蜜桃",price:333,count:"错别字",selected:false}]
private var aaa:Object
[Bindable]
public var dataArr:Array = new Array({label:"不合格", data:"2"},{label:"不合格", data:"3"},
{label:"进口", data:"4"}, {label:"一般", data:"5"});
[Bindable]
public var s:int = 2;
private function init():void{
}
public function saved():void{
// Alert.show("dfdfd");
var arr:Array = Application.application.dataArr2;
for each(var a:Object in arr){
Alert.show("当前数据为: \n" + "序号: " + a.id + ", 名称: " + a.name + ", 数量: " + a.count + ", selected: " + a.selected);
}
}
]]>
</mx:Script>
<mx:Component id="myComponent">
<mx:ComboBox x="179" y="1" width="67" dataProvider="{Application.application.dataArr}" selectedIndex="{Application.application.s}">
<mx:Script>
<![CDATA[
import mx.core.Application;
]]>
</mx:Script>
</mx:ComboBox>
</mx:Component>
<mx:Button click="saved()" x="441" y="46" label="保存"/>
<mx:DataGrid id="DataGrid2" editable="true" dataProvider="{Application.application.dataArr2}" y="76" x="10" height="266" width="516">
<mx:columns>
<mx:DataGridColumn headerText="序号" id="dg1" dataField="id" editable="false"/>
<mx:DataGridColumn headerText="名称" id="dg2" dataField="name"/>
<mx:DataGridColumn headerText="价格" id="dg3" dataField="price" editorDataField="value" editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:NumericStepper maximum="1000" minimum="10">
</mx:NumericStepper>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="描述" id="dg4" dataField="count" editable="true" editorDataField="text" itemEditor="{myComponent}"/>
<mx:DataGridColumn headerText="select" dataField="selected" editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:CheckBox click="data.selected=!data.selected" selected="{data.selected}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
分享到:
相关推荐
WPF中DataGrid里面的Checkbox实现单选关键代码, 文档里面的代码复制粘贴即可实现!本人也是项目需要写的一个功能11行代码实现此功能! 希望可以帮助到你们!
easyui的datagrid中editor和combobox的级联,在datagrid中编辑项是下拉框的实现方式
项目中用到DataGrid, 需要在第一列添加checkbox, 可以多选、全选。 其中涉及的概念DataTemplate, DataGridCellStyle, DataGridCellControlTemplate,Binding, OnPropertyChanged等。
在Flex的DataGrid中使用CheckBox 欢迎分享
Flex的DataGrid中使用CheckBox. 大家共同研究
wpf中DataGrid中使用combobox 的控件的小例子
实现了向dataGrid中添加checkBox的功能,可以支持多选,单选,全选。
NULL 博文链接:https://taomujian.iteye.com/blog/294748
WPF在DataGrid列中使用ComboBox绑定,改变ComboBox可回传至绑定的实体, 网上找了好久,终于搞定了,不是那个用枚举的例子!!ComboBox绑定的是一个实体列表. 程序名字叫 给唐僧选老婆!哈哈
easyui的datagrid中editor和combobox的级联
在flex中的datagrid中运用checkbox实现全选和单选
WPF下DataGrid每行设置不同的ComboBox的数据绑定 DataGrid设置一次ItemSource 每个ComboBox也要设置一次ItemSource 有点像通过两次映射来绑定
修改上一个资源版本中结束编辑时combobox显示问题. 1、类型为combogrid时每行的参数不同查询返回对应的数据结果。 2、类型为combobox时,输入框显示图标按钮,实现对应的事件。 3、解决类型为combobox显示为value而...
wpf 下DataGrid表头包含checkbox,实现多选功能,wpf 下DataGrid表头包含checkbox,实现多选功能
easyui datagrid 行编辑时 1、类型为combogrid时每行的参数不同查询返回对应的数据结果。 2、类型为combobox时,输入框显示图标按钮,实现对应的事件。 3、解决类型为combobox显示为value而不是text问题。
DataGrid中加入ComboBox的源码
Flex_全选或取消DataGrid中的checkbox, 解决了, flex的checkbox的问题
绝对好东西,datagrid 标题栏及 datagridcolumn 添加 checkbox
本文给大家分享jQuery EasyUI编辑DataGrid用combobox实现多级联动效果的实例代码,代码简单易懂,非常不错,具有参考借鉴价值,感兴趣的朋友一起看看吧