一个包含comboBox的grid,将comboBox中的value显示在输入框中
来源:互联网 发布:豆瓣 推荐算法 编辑:程序博客网 时间:2024/06/05 11:20
在做包含combobox的eidtorgridPanel的时候,我遇到了当选择了一个下拉列表中的value时,在输入框中却显示的是key值,后来经过网上搜索,发现其实是少了一个render属性,代码如下:
header : '表单名称',
width : 150,
dataIndex : 'defineId',
id : "defineId",
editor : new Ext.form.ComboBox({
triggerAction : 'all',//展示所有
editable : false,//不可手动填写
scope : this,
forceSelection : true,
id : "defineId_combo",
hiddenName : 'defineId',// 提交到后台的input的name
store : defineIdStore,//加载过来的数据
valueField : 'defineId',//输入框中值
allowBlank : false //不允许为空
}),
此时运行会出现我所描述的问题,后来我加了如下代码:
renderer : function(value, cellmeta, record) {
var index = defineIdStore
.find(Ext.getCmp('defineId_combo').valueField,value);
var record = defineIdStore.getAt(index);
var displayText = "";
if (record == null) {
displayText = value;
} else {
displayText = record.data.defineName;//
}
return displayText;
}
- 一个包含comboBox的grid,将comboBox中的value显示在输入框中
- Ext中combobox在grid显示问题
- Ext中combobox在grid显示问题
- Ext应用--Combobox在Grid中的查询与显示
- Ext中combobox在Grid里显示问题
- extjs grid combobox 的显示扩展
- 在dataGridView中显示combobox
- 解决:easyui中的datagrid详情展开,combobox的级联操作,以及修复combobox总是显示value值的问题
- C# Winform ComboBox 在输入内容时 会在下拉菜单中显示 根据输入内容查询的结果
- 不让用户在ComboBox 中输入
- extjs4中创建一个只显示‘年份数’的combobox
- Combobox下拉框加深显示Combobox中text的值,取消原有的填充显示
- 在修改信息窗口中,Ext.combobox的默认值显示
- 在ComboBox下拉框数据中显示图片
- easyui中combobox 验证输入的值必须为选项框中的数据
- easyui中combobox 验证输入的值必须为选项框中的数据
- easyui中combobox 验证输入的值必须为选项框中的数据
- editorGridPanel++中+有一列使用combobox+,选择后显示的是value+而不是name.+解决方法
- 即使上帝不宠我
- maven - 较复杂的实例
- java中long,int,short与byte数组之间的转
- CentOS 5.5 安装 mysql5.1
- pm2.5确认为致癌物 雾霾成"隐形杀手"
- 一个包含comboBox的grid,将comboBox中的value显示在输入框中
- 管程的通俗理解
- Linux环境编译安装Mysql以及补装innodb引擎方法
- C++ GUI Qt4编程-创建自定义窗口部件
- 手机自动休眠与距离感应器失效的问题
- Android 通用获取IP的方法
- c语言学习2
- MAC 地址格式 解说
- WAMP环境下 的 Zend Framework 配置