PDA

View Full Version : Ext.getCmp("grid_id").getSelectionModel().getSelections() doesnt work!!!



FlaminPhoenix
8 Jun 2010, 3:57 AM
I have a grid configured to use the checkbox selection model.. when i execute Ext.getCmp("grid_id").getSelectionModel() i get an ext object. but when i do a Ext.getCmp("grid_id").getSelectionModel().getSelections() "object doesnt support this property or method" error is thrown..

can someone tell me what im doing wrong?

FlaminPhoenix
8 Jun 2010, 4:17 AM
var selModel = Ext.getCmp("extDPIndexGrid").getSelectionModel();

var sel = selModel.getSelections();

ok, I did this, and I got the sel object, now, if I do a sel.length, I get a 0 even though I have one row selected!!

darthwes
8 Jun 2010, 5:34 AM
sel is of type Record.

CrazyEnigma
8 Jun 2010, 12:10 PM
@darthwes: sel in this case is an array, not a record. getSelected() will get you the record.

Have you tried seeing what you get in FireBug? Also, have you used the getCount() method on the selModel and see what you get?

Have you tried alert(Ext.getCmp("extDPIndexGrid").getXType()); and made sure it is a grid component?

Are there any listeners that are deselecting the objects?