Вот ответ, перенесите комбинированный магазин в область вашего рендерера:
http://jsfiddle.net/WRXcw/3/
Ext.define('GridModel', {
extend: 'Ext.data.Model',
fields: [{
name: 'id',
type: 'int'
},{
name: 'type_id',
type: 'int'
}]
});
Ext.define('ComboModel', {
extend: 'Ext.data.Model',
fields: [{
name: 'id',
type: 'int'
},{
name: 'label',
type: 'string'
}],
statics: {
TYPE_OPTION_ONE: 1,
TYPE_OPTION_TWO: 2,
TYPE_OPTION_THREE: 3,
TYPE_OPTION_FOUR: 4
}
});
var comboStore = Ext.create('Ext.data.Store', {
model: 'ComboModel',
data: [{
id: 1,
label: '1st Option'
},{
id: 2,
label: '2nd Option'
},{
id: 3,
label: '3rd Option'
}]
});
var gridStore = Ext.create('Ext.data.Store', {
model: 'GridModel',
data: [{
id: 1,
type_id: ComboModel.TYPE_OPTION_ONE
},{
id: 2,
type_id: ComboModel.TYPE_OPTION_TWO
},{
id: 3,
type_id: ComboModel.TYPE_OPTION_THREE
},{
id: 4,
type_id: ComboModel.TYPE_OPTION_TWO
}]
});
Ext.widget('grid', {
title: 'Rendering Combos',
width: 650,
height: 500,
renderTo: 'ct',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
store: gridStore,
forceFit: true,
columns: [{
dataIndex: 'id',
header: 'ID'
},{
dataIndex: 'type_id',
header: 'Type',
editor: {
xtype: 'combobox',
displayField: 'label',
valueField: 'id',
queryMode: 'local',
store: comboStore,
allowBlank: true
},
renderer: function(value) {
var rec = comboStore.getById(value);
if (rec)
{
return rec.get('label');
}
return '—';
}
}]
});