2
votes

In an ExtJS 4.1 grid that uses CheckboxModel as a selection model, when you click on an entire row, that row is selected (and the corresponding checkbox is checked). Is there a way that I can prevent that default behaviour from happening and permit row selection only when the checkbox for a corresponding row is clicked (as opposed to when clicking the entire row)?

Again I'm using ExtJS version 4.1

Thanks for any help

Note: My grid also has the CellEditing plugin attached to it. I don't want the row to be selected when the CellEditing plugin gets activated when I click on a cell.

1

1 Answers

2
votes

Try the checkOnly property on your CheckBoxModel:

var sm = new Ext.selection.CheckboxModel({
    checkOnly: true
});

From the documentation:

http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.selection.CheckboxModel-cfg-checkOnly

checkOnly : Boolean

True if rows can only be selected by clicking on the checkbox column.

Defaults to: false

Please see my fiddle here for a working example: https://fiddle.sencha.com/#fiddle/vue

Update

To change the CheckBoxModel checkOnly mode after the grid has been rendered:

grid.getSelectionModel().checkOnly = true;