View Full Version : CheckboxModel Selection Model select don't render on grid

21 Aug 2012, 11:25 AM
Hi, i have a problem checking multiple rows on a grid.

The selModel on my grid:

var selModel = new Ext.selection.CheckboxModel({
mode: 'MULTI'

Here i get the seleccion model:

var selModel = Ext.getCmp('myGrid').getSelectionModel();

Then if I use "selModel.select(2)" for example, it checks the 3rd row. All good by now.

If I pass an array, for example "selModel.select([0,2,3])" and then I call selModel.selected it returns the 3 rows selected but the checked items are not displayed in the grid.

I don't know is this is a bug or if I'm doing something wrong.


21 Aug 2012, 1:08 PM
You can't send an array of indexes to the select function. The select function only takes a single index or an array of records. You would have to get the record at each index and then send an array of those records.


21 Aug 2012, 2:10 PM
I also pass an array of the records I want to check and didnt work for me.

My solution was do selModel.selectAll() and then use selModel.deselect(here I pass the index or the record I want to deselect)

I think this is a patch but not a final solution.

Work for me.

22 Aug 2012, 4:40 AM
I just set up a quick test case and this is working for me:

var grid = Ext.getCmp('myGrid'),
store = grid.getStore(),
selModel = grid.getSelectionModel();