27

How i can create ExtJs grid panel with checkboxes like here.

2 Answers 2

50

In Ext 3.4, you'll want to use the Ext.grid.CheckColumn plugin as demonstrated in the EditorGrid sample included in the framework download.

In Ext 4+ there is a CheckColumn type built-in (xtype: 'checkcolumn').

Here's an example of what the column config looks like for a checkbox column in version 4+:

  xtype: 'checkcolumn',
  header: 'Active?',
  dataIndex: 'active', // model property to bind to
  width: 60,
  editor: {
    xtype: 'checkbox',
    cls: 'x-grid-checkheader-editor'
  }
4
3

How about using this?

var checkBoxSelMod = new Ext.grid.CheckboxSelectionModel();

:-D

You can switch position of check box by placing the selection model object at desired position in the column list. This will allow you to place multiple checkboxes in the grid.

2
  • How do you move the checkBoxSelMod around in the column list?
    – boatcoder
    Jan 7, 2012 at 3:03
  • For e.g., if you want it in the 3 column, then put checkBoxSelModel in the 3rd position in the cols attribute. Jan 8, 2012 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.