View Full Version : accessing combo's grid in renderer

13 Sep 2010, 2:17 AM
I have a combo in a grid and there is a store configured for the combo.
I want to access the combo's store( not the grid's store) in the renderer.
How can I do it?

var ColModel = new Ext.grid.ColumnModel([

{header: "Option", width: 70, dataIndex: "option", sortable: true, editor: { xtype: 'combo',
allowBlank: false,
store:new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'UnitService.asmx/getOptions', method: 'POST'}),
reader: new Ext.data.XmlReader({
record: 'Table'
}, [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]),
sortInfo:{field: 'name', direction: "ASC"},
autoLoad: true
mode: 'local', displayField: 'name', valueField: 'id'
}, align: 'left',

renderer: function(value, metaData, record, rowIndex, colIndex, store){
var idx = this.store.findExact('id', value);

13 Sep 2010, 2:58 AM
Create the combobox first and then the column model.

ps. You might want to use a combocolumn (http://www.sencha.com/forum/showthread.php?67488-3.x-Ext.grid.ComboColumn-amp-Ext.util.Format.comboRenderer).