Roo/grid/GridDragZone.js
[roojs1] / Roo / grid / GridDragZone.js
index 115204a..d7cb0e7 100644 (file)
@@ -32,7 +32,7 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
         var rowIndex = this.view.findRowIndex(t);
         var sm = this.grid.selModel;
             
-        Roo.log(rowIndex);
+        //Roo.log(rowIndex);
         
         if (sm.getSelectedCell) {
             // cell selection..
@@ -45,13 +45,14 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
         
         }
         
-        if(rowIndex !== false){
+        var sels = sm.getSelections ? sm.getSelections() : (
+                    sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : []);
+        
+        // before it used to all dragging of unseleted... - now we dont do that.
+        if(sels || sels.length){
             
             // if editorgrid.. 
-            if (sm.getSelectedCell && (!sm.getSelectedCell() || (sm.getSelectedCell()[0] == rowIndex) ) ) {
-                Roo.log([ sm.getSelectedCell() ? sm.getSelectedCell()[0] : 'NO' , rowIndex ]);
-                return false;
-            }
+            
             
             //Roo.log([ sm.getSelectedCell() ? sm.getSelectedCell()[0] : 'NO' , rowIndex ]);
                
@@ -69,13 +70,14 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
                 ddel: this.ddel,
                 rowIndex: rowIndex,
                 selections:sm.getSelections ? sm.getSelections() : (
-                    sm.getSelectedCell() ? [ grid.ds.getAt(sm.getSelectedCell()[0]) ] : []
+                    sm.getSelectedCell() ? [ this.grid.ds.getAt(sm.getSelectedCell()[0]) ] : []
                 )
             };
         }
         return false;
     },
-
+    
+    
     onInitDrag : function(e){
         var data = this.dragData;
         this.ddel.innerHTML = this.grid.getDragDropText();