【发布时间】:2012-01-12 14:52:47
【问题描述】:
我有 ExtJS 网格。我正在使用带有组合框的 Roweditor 插件。当我单击 Grid 的任何一行时,我可以看到带有更新和取消按钮的编辑器。
现在我面临的问题是当我单击行并启用行编辑器时,如果当前显示的值与组合存储匹配,那么它应该显示为选中,但它没有显示。如果我同时使用 valueField 和 displayField 的值,那么我可以看到它被选中。
我想我不能发布图片,所以我在这里给你代码:
如果我在 Combo 的商店中同时使用 valueField 和 displayField 的值,那么我可以看到选定的值。
editor: {
allowBlank: true,
selectOnFocus:true,
editable:true,
xtype:'combobox',
valueField:'id',
displayField:'status',
triggerAction:'all',
queryMode: 'local',
store:[['NOT_STARTED','NOT_STARTED'],
['IN_PROGRESS','IN_PROGRESS'],
['COMPLETED','COMPLETED']
],
value:0,
lazyRender: true
}
当我在 Combo 的商店中以不同方式分配 displayField 和 valueField 时,这是理想的情况,它不会向我显示所选内容。
editor: {
allowBlank: true,
selectOnFocus:true,
editable:true,
xtype:'combobox',
valueField:'id',
displayField:'status',
triggerAction:'all',
queryMode: 'local',
store:[['1','NOT_STARTED'],
['2','IN_PROGRESS'],
['3','COMPLETED']
],
value:0,
lazyRender: true
}
请告诉我这里出了什么问题。
您好,感谢您的回复,我已按照您的建议进行了更改,但不知何故对我不起作用。这是代码。我的店铺是
var data = {
root: [
{
"objectType":"com.yagna.common.domain.Project",
"objectId":"3072",
"expectedEndDate":"",
"startDate":"2011-06-27 13:06:00.0",
"name":"Milestone-11",
"actualEndDate":"",
"id":"4376",
"Status":"NOT_STARTED"
}] };
my Column is
{id: 'Status',width: 20,text: 'Status',dataIndex: 'Status',filter: {type: 'combobox'},sortable: true, groupable: false,
editor:{
allowBlank: true,
xtype:'combobox',
valueField:'field1',
displayField:'field2',
triggerAction:'all',
mode: 'local',
store: [['0','NOT_STARTED'],['1','IN_PROGRESS'],['2','COMPLETED']],
value:0,
lazyRender: true
} },
Please suggest what is missing here
【问题讨论】: