PDA

View Full Version : [FIXED-383][3.x] CheckColumn column identification bug



kamil.schvarcz
11 Dec 2009, 2:58 AM
Hi all,

I can explain one problem with CheckColumn implementation in gridpanel. In my application I need to have grid with cca 30-40 checkboxes in 10-20 rows. I need it for editor m:n tables relationships. Bug is when I edit column with ID >19. OnClick Event chcek two columns - first and checked.

Bug is in condition t.className.indexOf('x-grid3-cc-'+this.id) != -1, because when you edit column with ID 20 this return true when ID is 2 too.

Solution is change condition to t.className == 'x-grid3-check-col x-grid3-cc-'+this.id.

Best.

Kamil

mystix
11 Dec 2009, 3:35 AM
where is this line of code you referred to located?

i can't find it anywhere in ext-all-debug.js

ok nevermind it's a ux.
code's in CheckColumn.js

kamil.schvarcz
11 Dec 2009, 3:42 AM
yes, it's in ux CheckColumn.js

Condor
11 Dec 2009, 3:55 AM
No, that could break when another class is assigned to the element.

It should be:

Ext.override(Ext.ux.grid.CheckColumn, {
onMouseDown : function(e, t){
if(Ext.fly(t).hasClass('x-grid3-cc-'+this.id)){
e.stopEvent();
var index = this.grid.getView().findRowIndex(t);
var record = this.grid.store.getAt(index);
record.set(this.dataIndex, !record.data[this.dataIndex]);
}
}
});

kamil.schvarcz
11 Dec 2009, 4:00 AM
Condor,

thanks for your reply. It works fine.

Kamil

evant
14 Dec 2009, 5:05 AM
Fix applied to svn in rev #5777 for patch release 3.1.1.