PDA

View Full Version : Custom Checkbox selection model



harman
12 Jun 2013, 12:43 AM
Hi All,

I am using ExtJS 4.0.7. I have a requirement where in a grid i have put checkbox selection model.

var selModel = Ext.create('Ext.selection.CheckboxModel', { mode : 'SIMPLE'
});

I want to customize the selection of the row. It should be like:

User must be able to select the row by checkbox.
User must be able to select by clicking on the row.
When user clicks on a selected row then it should NOT get deselected.
The Only way to deselect will be checkbox.
I am able to achieve the first two by setting checkOnly : false and mode : 'SIMPLE'. But how do i implement the third point?

slemmon
13 Jun 2013, 2:07 PM
Looks like the desired behavior is the default for 4.2.1, but not for 4.0.7 (clicking on the checkbox does not deselect the selection in 4.0.7, but does in 4.2.1).

Can you upgrade your framework by chance?

If not you may have to do an override to either Ext.selection.checkboxModel or Ext.selection.Model. Not sure where the change is - wasn't obvious to me at first glance - you'll probably have to just trace where the request goes in 4.0.7 and evaluate the differences between the source on the two framework versions to get the override you're looking for.