65 lines
No EOL
1.7 KiB
JavaScript
65 lines
No EOL
1.7 KiB
JavaScript
/*
|
|
* Ext JS Library 1.0.1
|
|
* Copyright(c) 2006-2007, Ext JS, LLC.
|
|
* licensing@extjs.com
|
|
*
|
|
* http://www.extjs.com/license
|
|
*/
|
|
|
|
// private
|
|
// This is a support class used internally by the Grid components
|
|
Ext.grid.GridDragZone = function(grid, config){
|
|
this.view = grid.getView();
|
|
Ext.grid.GridDragZone.superclass.constructor.call(this, this.view.lockedBody.dom, config);
|
|
this.setHandleElId(Ext.id(this.view.lockedBody.dom));
|
|
this.setOuterHandleElId(Ext.id(this.view.mainBody.dom));
|
|
this.scroll = false;
|
|
this.grid = grid;
|
|
this.ddel = document.createElement('div');
|
|
this.ddel.className = 'x-grid-dd-wrap';
|
|
};
|
|
|
|
Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
|
|
ddGroup : "GridDD",
|
|
|
|
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);
|
|
}
|
|
return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
|
|
}
|
|
return false;
|
|
},
|
|
|
|
onInitDrag : function(e){
|
|
var data = this.dragData;
|
|
this.ddel.innerHTML = this.grid.getDragDropText();
|
|
this.proxy.update(this.ddel);
|
|
// fire start drag?
|
|
},
|
|
|
|
afterRepair : function(){
|
|
this.dragging = false;
|
|
},
|
|
|
|
getRepairXY : function(e, data){
|
|
return false;
|
|
},
|
|
|
|
onEndDrag : function(data, e){
|
|
// fire end drag?
|
|
},
|
|
|
|
onValidDrop : function(dd, e, id){
|
|
// fire drag drop?
|
|
this.hideProxy();
|
|
},
|
|
|
|
beforeInvalidDrop : function(e, id){
|
|
|
|
}
|
|
}); |