PDA

View Full Version : [FIXED-1012] CheckboxSelectionModel



zlesko
24 May 2010, 9:43 AM
Ext version tested:


Ext 3.2.x



Browser versions tested against:


FF3.6.3 (firebug 1.5.3 installed)



Operating System:


Win 7
WinXP Pro



Test Case:

See this URL : http://www.extjs.com/deploy/dev/examples/grid/grid-plugins.html


Steps to reproduce the problem:


Click on a row to select it.
Then, click a checkbox (other than the "select all" box). No effect.
Then, click a checkbox a second time and it will select/deselect.
This seems to happen every time a row is clicked. Using only checkboxes to select seems to work.



The result that was expected:


First click on a checkbox after selecting a row should have some effect.

zlesko
1 Jun 2010, 3:33 AM
Any update on this? This problem occurs in IE as well.

Eric24
10 Jun 2010, 2:56 PM
Just confirming this bug; it was introduced within the last two releases.

Condor
11 Jun 2010, 3:58 AM
Can I suggest:

Ext.grid.CheckboxSelectionModel = Ext.extend(Ext.grid.RowSelectionModel, {
header : '<div class="x-grid3-hd-checker"> </div>',
width : 20,
sortable : false,
menuDisabled : true,
fixed : true,
hideable: false,
dataIndex : '',
id : 'checker',
/*constructor : function(){
Ext.grid.CheckboxSelectionModel.superclass.constructor.apply(this, arguments);
if(this.checkOnly){
this.handleMouseDown = Ext.emptyFn;
}
},*/
initEvents : function(){
Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);
this.grid.on('render', function(){
var view = this.grid.getView();
//view.mainBody.on('mousedown', this.onMouseDown, this);
Ext.fly(view.innerHd).on('mousedown', this.onHdMouseDown, this);
}, this);
},
handleMouseDown : function(grid, rowIndex, e) {
if(e.button === 0 && e.getTarget().className == 'x-grid3-row-checker'){
e.stopEvent();
if(this.isSelected(rowIndex)){
this.deselectRow(rowIndex);
}else{
this.selectRow(rowIndex, true);
grid.getView().focusRow(rowIndex);
}
return;
}
if (!this.checkOnly) {
Ext.grid.CheckboxSelectionModel.superclass.handleMouseDown.apply(this, arguments);
}
//this.mouseHandled = true;
},
/*onMouseDown : function(e, t){
if(e.button === 0 && t.className == 'x-grid3-row-checker'){
e.stopEvent();
var row = e.getTarget('.x-grid3-row');
if(!this.mouseHandled && row){
var index = row.rowIndex;
if(this.isSelected(index)){
this.deselectRow(index);
}else{
this.selectRow(index, true);
this.grid.getView().focusRow(index);
}
}
}
this.mouseHandled = false;
},*/
onHdMouseDown : function(e, t){
if(t.className == 'x-grid3-hd-checker'){
e.stopEvent();
var hd = Ext.fly(t.parentNode);
var isChecked = hd.hasClass('x-grid3-hd-checker-on');
if(isChecked){
hd.removeClass('x-grid3-hd-checker-on');
this.clearSelections();
}else{
hd.addClass('x-grid3-hd-checker-on');
this.selectAll();
}
}
},
renderer : function(v, p, record){
return '<div class="x-grid3-row-checker"> </div>';
}
});
(and IMHO we should also use grid.headerclick instead of innerHd.mousedown)

evant
20 Sep 2010, 8:42 AM
I believe this issue has been resolved as of the 3.3 beta. Can others confirm?

zlesko
21 Sep 2010, 8:51 AM
Yes, it does seem to be resolved as of 3.3 beta 2.

Sesshomurai
5 Nov 2010, 5:45 AM
I am using 3.3beta and CheckboxSelectionModel doesn't work with multiselect.

keckeroo
17 Mar 2011, 8:00 AM
Multi select is still not working in 3.3.1 .... initEvents is not called.

Kevin