2
votes

As we know, extjs4 provides a grid build-in checkcolumn, but seems this type only can bind with special bool type. My requirement is only want to show a checkbox in grid, don't want to bind to any field.

How can I achieve that?

Thanks

1
And may I as what is the purpose of only showing the checkbox and not binding it to a field? - Abdel Raoof Olakara
yes, I just want to this column can let user select record, then do some operations - user1438980

1 Answers

5
votes

Use CheckboxModel as a selection model for your grid. Basic usage:

var grid2 = Ext.create('Ext.grid.Panel', {
    selModel: Ext.create('Ext.selection.CheckboxModel'),
    // ...
});

See "Framed with Checkbox Selection and Horizontal Scrolling" example at official examples page.