PDA

View Full Version : ComboBox "onselect" event get other column's value of the grid row



pst
27 Dec 2010, 7:13 AM
Hi,

In EditorGridPanel on of my column contains a ComboBox. In the “onselect” event of the ComboBox I need to get a value of other column of the same grid row. How can I do it, please suggest.

Thanks.

Condor
27 Dec 2010, 10:03 AM
Do you really need to do this from the 'select' event or would be using the afteredit event of the grid work too?

pst
27 Dec 2010, 8:55 PM
Hi Condor,

Actually I need to do post back in "onselect" event of the Combo Box with the selected Combo Box value as well as grid row key value which is record id stored in one of the grid column.

Please suggest,

Condor
28 Dec 2010, 12:03 AM
But the select event doesn't actually change the record yet. Only the blur event does that (which in turn fires the afteredit event).

Do you still need to use the select event?

In that case you can use:

editor: new Ext.grid.GridEditor(new Ext.form.ComboBox({
listeners: {
select: function(combo, record, index) {
var id = combo.record.id;
...
}
}
}), {
listeners: {
beforestartedit: function(editor, el, value) {
// copy current record to combobox
editor.field.record = editor.record;
}
}
})