X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fgrid%2FGridDragZone.js;h=70932cc8b368d3919c40625b27267d7d20c982c3;hb=86b8de9b171833430cbdebcd05af0a1240f5832f;hp=115204a1eb353087f395173341db0240ff3bd711;hpb=a9e28a377095da11fa7f952ef56a353065ac7f83;p=roojs1 diff --git a/Roo/grid/GridDragZone.js b/Roo/grid/GridDragZone.js index 115204a1eb..70932cc8b3 100644 --- a/Roo/grid/GridDragZone.js +++ b/Roo/grid/GridDragZone.js @@ -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.. @@ -44,14 +44,16 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, { } } + if (sm.getSelections && sm.getSelections().length < 1) { + return false; + } + + // before it used to all dragging of unseleted... - now we dont do that. if(rowIndex !== false){ // 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 ]); @@ -68,14 +70,14 @@ Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, { grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, - selections:sm.getSelections ? sm.getSelections() : ( - sm.getSelectedCell() ? [ grid.ds.getAt(sm.getSelectedCell()[0]) ] : [] - ) + 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();