CheckboxSelectionModel in ExtJS grid

I’ve tried to use CheckboxSelectionModel on grid, and there are no examples in documents for. It’s not clear in documentation. Ok, so you should create CheckboxSelectionModel object before it’s passing to grid as selModel, because you should specify it in columns config property. So there is example by the steps.

  1. Create CheckboxSelectionModel:
var sm = new Ext.grid.CheckboxSelectionModel();
  1. Include created object in columns list:
columns:[

sm,


{….. rest of your columns …..}

]

  1. Provide selectionModel object as current selection model for grid. You should provide selModel property in config options:
selMode: sm

Result:


Advertisements

4 comments so far

  1. iamdanw on

    Thank you for posting this. I was stumped by CheckboxSelectionModel but it turns out it should be added to the column definition too.

  2. aitplus on

    Thank you very much. Helped my a lot.

    🙂 already searching for more than hour why the check box selection model does not show up. Key is to use the ‘sm’ as a column.

  3. me on

    TQ.this is the best way for me to learn checkbox.
    Will promote this web in my blog.


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: