Hi Scott, I'm not sure if I'm already doing what you're asking. Perhaps not. How do you specify a renderer under edit mode?
I'm having some troubles with fiddle. But here's along the line of what I have.
Code:
Ext. define('mygrid', {
exend: 'Ext.grid.Panel',
alias: 'widget.mygrid',
plugins: [
{
clickstoedit: 2,
ptype: 'rowediting'
}
]
initComponent: function() {
var comboStore = new Ext.data.Store({
fields: ['value', 'label'];
data: [
{value: 1, label: 'option 1'},
{value: 2, label: 'option 2}
]
});
Ext.apply(this, {
columns: [
{
text: 'Column 1',
dataIndex: 'col1',
},
{
text: 'Column 2',
dataIndex: 'col2',
editor: {
xtype: 'combobox',
store: comboStore,
displayField: 'label',
valueField: 'value'
},
renderer: function(val, meta, record, rindex, cindex, store) {
var indx = comboStore.find('value', val);
return idx !== -1 ? comboStore.getAt(idx).get('label');
}
}
],
tbar: [ {
itemId: 'addRow',
text: 'Add Row'
handler: function(button) {
var rowEditing = button.up('gridpanel').getPlugin('rowediting');
rowEditing.cancelEdit();
var r = Ext.create('myModel', {
col1: 'Default Name',
col2: '1' // option 1
}
}
}
]
});
this.callParent();
}