PDA

View Full Version : CheckboxSelectionModel can't do multiple selection



ang89
8 Nov 2009, 1:22 AM
Hi there,

I'm trying to attach a checkbox selection model to my grid. I construct the selection model without initial configuration (by default, singleSelect is set to false).

The checkboxs are shown, but they don't allow multiple selection. Whenever I click on another checkbox, the last checkbox is unselected. However, I can still do multiple selection by Ctrl/Shift + click.

Below is the snippet. Any clue?

// Column display model
var column_model = new Ext.grid.ColumnModel([
new Ext.grid.CheckboxSelectionModel(),
{
id: 'id', header: 'ID', dataIndex: 'id', editable: false,
align: 'right', width: 50
}, {
id: 'name', header: 'Name', dataIndex: 'name',
editor: new Ext.form.TextField({ allowBlank: false })
}
]);

// Selection model
var selection_model = new Ext.grid.RowSelectionModel();

// The grid to be displayed
var instructor_grid = new Ext.grid.EditorGridPanel(
{
frame: false,
height: 300,
store: store,
cm: column_model,
sm: selection_model,
autoExpandColumn: 'name',
clicksToEdit: 1,
renderTo: 'instructor_grid'
});

ang89
8 Nov 2009, 5:31 AM
Anyone?

carol.ext
8 Nov 2009, 1:19 PM
You are using CheckboxSelectionModel as a column only, not as the selection model? Compare to the plugins example (http://www.extjs.com/deploy/dev/examples/grid/grid-plugins.html).

ang89
9 Nov 2009, 5:21 AM
You are using CheckboxSelectionModel as a column only, not as the selection model? Compare to the plugins example (http://www.extjs.com/deploy/dev/examples/grid/grid-plugins.html).

Thanks you !!