Gerrat
Gerrat

Reputation: 29680

How can I get the current row in a grid with a combobox editor

I have an EditorGridPanel with a ComboBox in one of the columns.
Within a 'select' event listener for that ComboBox, I'd like to know which grid row (not ComboBox row) it is on.
The reason is that I'd like to update a different column in the grid every time an item is selected.
I think I'm likely missing something obvious.

Thanks for any help.

Upvotes: 3

Views: 4834

Answers (3)

Mike
Mike

Reputation: 81

Also in ExtJS 6 you can use undocumented property context which contains record.

grid.editingPlugin.context.record

Upvotes: 0

Gerrat
Gerrat

Reputation: 29680

Ok, for anyone else looking to try this, I found what seems to be an undocumented property of an EditorGridPanel: activeEditor.
This property contains a 'record' property that is a reference to the current record of the ComboBox (or anything really) being edited.
It may be a little frail (since it's undocumented), but seems to work.

In ExtJs 4.2, the property of the grid (for cellediting plugin) to use is:

grid.editingPlugin.getActiveRecord()

The property editingPlugin still seems undocumented, while getActiveRecord() is.

Upvotes: 1

Chris Farmer
Chris Farmer

Reputation: 25386

As of 4.1, it might be best to use the edit event of the grid instead. You get passed in an event which contains the edited record.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.Panel-event-edit

Upvotes: 2

Related Questions