4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
13 // This is a support class used internally by the Grid components
14 Roo.grid.GridDragZone = function(grid, config){
15 this.view = grid.getView();
16 Roo.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config);
17 if(this.view.lockedBody){
18 this.setHandleElId(Roo.id(this.view.mainBody.dom));
19 this.setOuterHandleElId(Roo.id(this.view.lockedBody.dom));
23 this.ddel = document.createElement('div');
24 this.ddel.className = 'x-grid-dd-wrap';
27 Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
30 getDragData : function(e){
31 var t = Roo.lib.Event.getTarget(e);
32 var rowIndex = this.view.findRowIndex(t);
33 var sm = this.grid.selModel;
37 if (sm.getSelectedCell) {
39 if (!sm.getSelectedCell()) {
42 if (rowIndex != sm.getSelectedCell()[0]) {
48 if(rowIndex !== false){
53 //Roo.log([ sm.getSelectedCell() ? sm.getSelectedCell()[0] : 'NO' , rowIndex ]);
55 //if(!sm.isSelected(rowIndex) || e.hasModifier()){
59 sm.handleMouseDown(e, t); // non modifier buttons are handled by row select.
62 Roo.log("getDragData");
68 selections:sm.getSelections ? sm.getSelections() : (
69 sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : []
76 onInitDrag : function(e){
77 var data = this.dragData;
78 this.ddel.innerHTML = this.grid.getDragDropText();
79 this.proxy.update(this.ddel);
83 afterRepair : function(){
84 this.dragging = false;
87 getRepairXY : function(e, data){
91 onEndDrag : function(data, e){
95 onValidDrop : function(dd, e, id){
100 beforeInvalidDrop : function(e, id){