Yasser1984
Yasser1984

Reputation: 2451

How to turn on multiselect checkbox mode on a grid in ext js

I am experimenting with this: http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/infinite-scroll.html

I'm trying to make it possible for the grid to have checkboxes beside each row, so that a user can select multiple rows.

I tried:

SelModel: 'CheckboxSelectionModel',

In the configs, it didn't make a difference, I've also removed this line:

disableSelection: true,

Upvotes: 3

Views: 7740

Answers (1)

Abdel Raoof Olakara
Abdel Raoof Olakara

Reputation: 19353

You need to create an instance of the selection model class. For example, you can have it in your grid panel's initComponent method:

this.selModel= Ext.create('Ext.selection.CheckboxModel');

or you could add the following into grid's config:

selModel : Ext.create('Ext.selection.CheckboxModel')

If you see the API documentation, the selModel requires a Object and not a string.

Upvotes: 7

Related Questions