PDA

View Full Version : Possible bug -- GridDragZone + AbstractSelectionModel (1.0.1a, 1.1beta1,2)



MaximGB
30 Jun 2007, 2:49 PM
Hi.

Ext.grid.GridView uses Ext.grid.GridDragZone when enableDragDrop set to true in grid, Ext.grid.GridDragZone uses grid selection model handleMouseDown() method, which is marked as private and not defined in Ext.grid.AbstractSelectionModel() - this is bug enabled peace of code IMO ;)



getDragData : function(e){
var t = Ext.lib.Event.getTarget(e);
var rowIndex = this.view.findRowIndex(t);
if(rowIndex !== false){
var sm = this.grid.selModel;
if(!sm.isSelected(rowIndex) || e.hasModifier()){
sm.handleMouseDown(e, t); // <- - - Warning!!
}
return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
}
return false;
},

jack.slocum
30 Jun 2007, 3:31 PM
GridDragZone is only compatible with RowSelectionModel which does have a handleMouseDown method. The function is package private, which means other classes in the package are able to call it as needed.

MaximGB
30 Jun 2007, 6:29 PM
GridDragZone is only compatible with RowSelectionModel which does have a handleMouseDown method. The function is package private, which means other classes in the package are able to call it as needed.
Does it mean that it's not permitted to do like this:


var myGrid = new Ext.grid.Grid({
...
sm: new MySuperUltraSelectionModel(),
...
});

Ext.extend(MySuperUltraSelectionModel, Ext.grid.AbstractSelectionModel, {
...
});

???

jack.slocum
30 Jun 2007, 7:45 PM
You can of course, but if you do you will have to have a similar function to have dnd support.