editorGridPanel++中+有一列使用combobox+,选择后显示的是value+而不是name.+解决方法
来源:互联网 发布:deb怎么安装 ubuntu 编辑:程序博客网 时间:2024/05/17 07:21
_afterEditorEvent : function(obj){
var scope = this;
if (obj.value === ""){
return obj.value;
}
var bscStore = scope.comboxBsc.store;
var bscLabel;
for ( var i = 0; i < bscStore.data.length; i++) {
if (bscStore.data.items[i].data.value == obj.value) {
bscLabel= bscStore.data.items[i].data.name;
alert(bscLabel);
break;
}
}
//obj.record.data['RELATED_NEW_BSC_LABEL']=bscLabel;
scope.comboxBsc.setRawValue(bscLabel);
}
Ext editorGridPanel 中 有一列使用combobox ,选择后显示的是value 而不是name,我的combobox store是动态加载?每一行在编辑之前加载的。
上面是我用afterEditorEvent事件去设置显示的内容,但还是显示的是value ,求解???
终于找到解决方法了 :
_afterEditorEvent : function(obj){
var scope = this;
if (obj.value === ""){
return obj.value;
}
var bscStore = scope.comboxBsc.store;
var bscLabel;
for ( var i = 0; i < bscStore.data.length; i++) {
if (bscStore.data.items[i].data.value == obj.value) {
bscLabel= bscStore.data.items[i].data.name;
break;
}
}
var rd = obj.record;
rd.set('RELATED_NEW_BSC_LABEL' ,bscLabel); //设置combox 显示的name。
rd.set('RELATED_NEW_BSC_CUID' ,obj.value); //隐藏列显示combox 的value.
//rd.commit(); 加了commit ()修改后就不会标记红色提示。
}
第二种简单的方法:
this.useageStore = new Ext.data.ArrayStore({
fields : ["value", "label"],
data : [["T_LOGIC_DEVICE_MSCSERVER", "信令"],
["T_LOGIC_DEVICE_MGW", "媒体"],
["T_LOGIC_DEVICE_BSC", "复用"]]
});
this.useageCombo = new Ext.form.ComboBox ({
id : "USEAGE",
store : this.useageStore,
valueField : 'value',
displayField : 'label',
editable : true,
typeAhead : false,
width : 150,
forceSelection : true,
lazyRender :true,
allowBlank : false,
emptyText :'请选择',
mode : 'local',
triggerAction : 'all'
});
column :
{
header : "用途",
dataIndex : "USEAGE",
width : 160,
editor : this.useageCombo,
renderer : {fn:function (value){
for ( var i = 0; i < this.useageStore.data.length; i++) {
if ( this.useageStore.data.items[i].data.value == value) {
return this.useageStore.data.items[i].data.label;
}
}
return value;
} ,scope : this}
- editorGridPanel++中+有一列使用combobox+,选择后显示的是value+而不是name.+解决方法
- easyui datagrid combobox 选择后显示valueField 而不是 textValue解决方法
- 如果使用Ext.form.ComboBox 作为editor,并设置了store,在选择后,在表格单元中显示的是store中的displayfield 而不是valuefield
- Extjs EditorGridPanel中ComboBox列的显示问题(默认显示键而不是值)
- Ext EditorGridPanel 下拉选择后显示value值
- Extjs EditorGridPanel中ComboBox列的显示问题
- extjs的EditorGridPanel中的ComboBox列中显示值的问题
- extjs的EditorGridPanel中的ComboBox列中显示值的问题
- easy ui 表格格式化动态绑定,表格格式化后获取表格值是value而不是显示的值
- EasyUI的combobox加载的内容不能选择--value有重复值
- 一个包含comboBox的grid,将comboBox中的value显示在输入框中
- EasyUI使用combobox的下拉框,显示第一个option的值,而不是text的问题
- 解决编辑时combobox显示编号而不是文本的问题
- 关于jQ中$(selector).data(name,value)方法的使用
- 是赚钱多的程序员选择使用空格键,而不是使用空格键使程序员赚钱多
- DataGrid中有一列是CheckBox,要求点一个CheckBox,对应的这一行变色,
- 用DataReader在comboBox中显示name,取值id:
- 遍历字典遍历的是key而不是value!!!
- Where 和Having的区别
- Dom4j 操作XML
- java集合
- H3C和CISCO设备之间的ipsec vpn 配置实例
- 设置和获取RelativeLayout高度和宽度
- editorGridPanel++中+有一列使用combobox+,选择后显示的是value+而不是name.+解决方法
- CListCtrl用法 CListCtrl使用详解 (代码)
- Android媒体相关开发应用程序接口
- 浅谈Nutch插件机制(含开发实例)
- python shell
- 前端优化总结
- differ Star Schema vs Snowflake
- 如何提高Android程序性能的简介与内容
- SQL2005附加数据库,提示 数据库 版本为655,无法打开,此服务器支持611版...