Roo.grid.GridDragZone = function(grid, config){
this.view = grid.getView();
Roo.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config);
if(this.view.lockedBody){
this.setHandleElId(Roo.id(this.view.mainBody.dom));
this.setOuterHandleElId(Roo.id(this.view.lockedBody.dom));
}
this.scroll = false;
this.grid = grid;
this.ddel = document.createElement('div');
this.ddel.className = 'x-grid-dd-wrap';
};
Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
ddGroup : "GridDD",
getDragData : function(e){
var t = Roo.lib.Event.getTarget(e);
var rowIndex = this.view.findRowIndex(t);
var sm = this.grid.selModel;
if (sm.getSelectedCell) {
if (!sm.getSelectedCell()) {
return false;
}
if (rowIndex != sm.getSelectedCell()[0]) {
return false;
}
}
if(rowIndex !== false){
if (e.hasModifier()){
sm.handleMouseDown(e, t); }
Roo.log("getDragData");
return {
grid: this.grid,
ddel: this.ddel,
rowIndex: rowIndex,
selections:sm.getSelections ? sm.getSelections() : (
sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : []
)
};
}
return false;
},
onInitDrag : function(e){
var data = this.dragData;
this.ddel.innerHTML = this.grid.getDragDropText();
this.proxy.update(this.ddel);
},
afterRepair : function(){
this.dragging = false;
},
getRepairXY : function(e, data){
return false;
},
onEndDrag : function(data, e){
},
onValidDrop : function(dd, e, id){
this.hideProxy();
},
beforeInvalidDrop : function(e, id){
}
});