i have a grid in ext 3.4 having one of the columns with a combobox editor. {header: ' Facility', dataIndex: 'facility',editor: borrfacCombo}
The underlying store of the grid has 2 fields (and more) - facility and facilityid
The editor combo is loaded from a store which has a mapping of id and description(something similar to below):
borrfacCombo=Ext.create('Ext.form.field.ComboBox',
{ displayField: 'name',
valueField: 'id',
store: {
fields: ['id', 'name'],
data: [
{id: 'scheme2', name: 'Green Envy'},
...
]
}
});
When a particular 'facility' is selected in the combo - I need the corresponding 'facilityid' to be populated in the selected row of the grid's store.
i am trying the following on 'select' in the combo -
listeners:{
select:function(combo, record, index) {
var val=record.get('id');
var grid=combo.ownerCt.floatParent;
var selectedRecord = grid.getSelectionModel().getSelection()[0];
.... }
}
But 'combo.ownerCt' always shows up as 'undefined'.
How do I resolve this ?
Ext.getCmp("yourGridId")
. Otherwise, one of the following could also work:combo.up('grid')
(if combo is a child of the grid, for instance because it is in the grid's toolbar),combo.up('panel').down('grid')
(if grid and combo are in the same panel)... – Alexander