0
我有具有動態列的網格。當用戶點擊此列時,它會顯示商店返回值的列表。一旦用戶選擇了任何值,我希望displayfield顯示值而不顯示該值的數字ID(鍵)。Extjs Grid Column-在值更改後顯示鍵而不是值
.....................
......................
plugins : [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
pluginId: 'Editor',
listeners : {
delay:1,
scope: this
}
})
],
doAfterFilterRendered : function() {
for (var i = 0; i <Ext.getCmp('ReportGrid').gridColumns.length; i++) {
if (ColumnGridType == 'COMBOBOX')// base on some condition i m trying to create combo box
{
Ext.getCmp('ReportGrid').gridColumns[i].editor= {
xtype: 'combobox',
forceSelection: true,
id : 'idCombo'
editable: false,
triggerAction: 'all',
allowBlank: false,
store: me.getColumnStoreList("Country")// which return 2 dimentional array with key value
}
}
}
Ext.getCmp('ReportGrid').getStore().load();
Ext.getCmp('ReportGrid').reconfigure(Ext.getCmp('ReportGrid').store, Ext.getCmp('ReportGrid').gridColumns);
},
......................
........................
我試過下面的東西來顯示值而不是關鍵。
doAfterFilterRendered : function() {
for (var i = 0; i <Ext.getCmp('ReportGrid').gridColumns.length; i++) {
if (ColumnGridType == 'COMBOBOX')// base on some condition i m trying to create combo box
{
Ext.getCmp('ReportGrid').gridColumns[i].editor= {
xtype: 'combobox',
forceSelection: true,
id : 'idCombo'
editable: false,
triggerAction: 'all',
allowBlank: false,
store: me.getColumnStoreList("Country") // which return 2 dimentional array with key value,
**fields: ['key', 'value']}),
valueField: 'key',
displayField: 'value',**
}
}
}