PDA

View Full Version : [OPEN-EXTJSIV-1805]Grid selection model



AndreKR
30 Apr 2011, 11:44 AM
I think it is undocumented how the selection models work in ExtJS4 grids.

From Ext.panel.Table.getSelectionModel() I figured out that the way to configure the selection model of a grid is like this:

selModel: {
selType: 'RowModel',
mode: 'MULTI',
allowDeselect: true
}

This fails with an error:
'selection.RowModel' is a singleton and cannot be instantiated
which is done in this line:

this.selModel = Ext.create('selection.' + type, this.selModel);

The very similar code in Ext.view.AbstractView.getSelectionModel() uses this line:

me.selModel = Ext.create('Ext.selection.DataViewModel', me.selModel);

So I suspect there is something wrong here. Maybe just someone forgot the "Ext.", maybe there's more to it. (I cannot tell because I don't know how ExtJS4 selection models are supposed to work.)

SGM
2 May 2011, 3:25 PM
I run into the same issue. It seems to be working when you remove the selType and leave just


selModel: {
mode: 'MULTI',
allowDeselect: true
}