PDA

View Full Version : enableDragDrop brakes checkcolumn in EditorGridPanel



predator
15 Jan 2011, 7:09 PM
I may be very well wrong.. but i cannot check or uncheck any checkcolumn in a EditorGridPanel if I enable DragDrop on it.

Ext JS Library 3.3.1

There is also plugin rowActions in that grid panel... but removing it didn't change the situation. Only after i commented out the DD related configs the checkcolumn start work as expected.

Thanks

Condor
16 Jan 2011, 5:34 AM
CheckColumn uses the 'mousedown' event to toggle the checkbox. If you want to use it icw D&D, then you will have to change this to the 'click' event.

And while we're on the subject of CheckColumn: It is using the wrong class to call the superclass processEvent.

Ext.ux.grid.CheckColumn = Ext.extend(Ext.grid.Column, {
processEvent : function(name, e, grid, rowIndex, colIndex){
if (name == 'click'/*'mousedown'*/) {
var record = grid.store.getAt(rowIndex);
record.set(this.dataIndex, !record.data[this.dataIndex]);
return false;
} else {
return Ext.ux.grid.CheckColumn/*Ext.grid.ActionColumn*/.superclass.processEvent.apply(this, arguments);
}
},
renderer : function(v, p, record){
p.css += ' x-grid3-check-col-td';
return String.format('<div class="x-grid3-check-col{0}"> </div>', v ? '-on' : '');
},
init: Ext.emptyFn
});

predator
16 Jan 2011, 9:48 AM
Thanks for your help. I will try the suggestions.