mcryan
18 Aug 2011, 4:26 AM
Not sure if this should be posted in the bugs section or if I am missing something obvious here.
As the title suggests, I have a combobox in a grid with cell editing. Once I select an option from the combo, the cell is updated with the valueField rather than the configured display field, though the dropdown is correctly displaying the displayField
Here is my code:
Ext.define('Grid', {
extend: 'Ext.grid.Panel',
requires: [
'Ext.grid.plugin.CellEditing',
'Ext.form.field.Text',
'Ext.toolbar.TextItem'
],
initComponent: function() {
this.editing = Ext.create('Ext.grid.plugin.CellEditing');
Ext.apply(this, {
iconCls: 'icon-grid',
frame: false,
plugins: [this.editing],
columns: [{
text: 'ID',
width: 40,
sortable: true,
dataIndex: 'id',
hidden: true
}, {
header: 'Type',
width: 120,
sortable: true,
dataIndex: 'type',
field: {
xtype: 'combobox',
queryMode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'id',
'name'
],
data: [[1, 'Email'], [2, 'SMS']]
}),
valueField: 'id',
displayField: 'name',
triggerAction: 'all'
}
}]
});
this.callParent();
}
});
As the title suggests, I have a combobox in a grid with cell editing. Once I select an option from the combo, the cell is updated with the valueField rather than the configured display field, though the dropdown is correctly displaying the displayField
Here is my code:
Ext.define('Grid', {
extend: 'Ext.grid.Panel',
requires: [
'Ext.grid.plugin.CellEditing',
'Ext.form.field.Text',
'Ext.toolbar.TextItem'
],
initComponent: function() {
this.editing = Ext.create('Ext.grid.plugin.CellEditing');
Ext.apply(this, {
iconCls: 'icon-grid',
frame: false,
plugins: [this.editing],
columns: [{
text: 'ID',
width: 40,
sortable: true,
dataIndex: 'id',
hidden: true
}, {
header: 'Type',
width: 120,
sortable: true,
dataIndex: 'type',
field: {
xtype: 'combobox',
queryMode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'id',
'name'
],
data: [[1, 'Email'], [2, 'SMS']]
}),
valueField: 'id',
displayField: 'name',
triggerAction: 'all'
}
}]
});
this.callParent();
}
});