PDA

View Full Version : Grid getSelection() returns empty array



oz-on
16 Aug 2011, 2:14 AM
Hi

I have a grid with CellEditing plugin and one of the cells has a combobox. When the user selects a value from the combobox, I need to set some default values for other cells on the same row.

I'm using
Ext.getCmp('lineItemsGrid').getSelectionModel().getSelection(), but that method returns an empty array.

I asked same question on StackOverflow, but I don't want to do this on grid edit event, rather do it when the user selects from combobox.
http://stackoverflow.com/questions/7064699/extjs4-editable-grid-getting-selected-row-returns-empty

I created a JSFiddle file in case you want to have a look and play around.
http://jsfiddle.net/Z6b7a/8/

When you select an item from the Light dropdown, it should spit out the values to the console.

Any help is greatly appreciated.

Thanks
Oz

oz-on
17 Aug 2011, 12:35 AM
*bump*

oz-on
17 Aug 2011, 1:48 AM
In case anyone follows this thread, I've found the solution.

Apprarently, it didn't like me to define the selection model, perhaps that was wrong, as I'm a newbie.



....
selModel: { selType: 'cellmodel'
},
....


Updated and working JSFiddle: http://jsfiddle.net/Z6b7a/9/

Cheers
Oz