@@ -333,7 +333,6 @@ export default class CellManager {
333
333
334
334
_selectArea ( $cell1 , $cell2 ) {
335
335
if ( $cell1 === $cell2 ) return false ;
336
-
337
336
const cells = this . getCellsInRange ( $cell1 , $cell2 ) ;
338
337
if ( ! cells ) return false ;
339
338
@@ -346,7 +345,7 @@ export default class CellManager {
346
345
}
347
346
348
347
getCellsInRange ( $cell1 , $cell2 ) {
349
- let colIndex1 , rowIndex1 , colIndex2 , rowIndex2 ;
348
+ let colIndex1 , rowIndex1 , colIndex2 , rowIndex2 , sortedColumns ;
350
349
351
350
if ( typeof $cell1 === 'number' ) {
352
351
[ colIndex1 , rowIndex1 , colIndex2 , rowIndex2 ] = arguments ;
@@ -360,9 +359,18 @@ export default class CellManager {
360
359
const cell2 = $ . data ( $cell2 ) ;
361
360
362
361
colIndex1 = + cell1 . colIndex ;
363
- rowIndex1 = + cell1 . rowIndex ;
364
362
colIndex2 = + cell2 . colIndex ;
365
- rowIndex2 = + cell2 . rowIndex ;
363
+ if ( this . datamanager . getColumn ( colIndex1 ) . sortOrder != "none" || this . datamanager . getColumn ( colIndex2 ) . sortOrder != "none" ) {
364
+ sortedColumns = true ;
365
+ rowIndex1 = this . datamanager . rowViewOrder . indexOf ( parseInt ( cell1 . rowIndex ) )
366
+ rowIndex2 = this . datamanager . rowViewOrder . indexOf ( parseInt ( cell2 . rowIndex ) )
367
+ } else {
368
+ rowIndex1 = + cell1 . rowIndex ;
369
+ rowIndex2 = + cell2 . rowIndex ;
370
+ }
371
+
372
+
373
+
366
374
}
367
375
368
376
if ( rowIndex1 > rowIndex2 ) {
@@ -394,7 +402,9 @@ export default class CellManager {
394
402
}
395
403
colIndex = colIndex1 ;
396
404
} ) ;
397
-
405
+ if ( sortedColumns ) {
406
+ cells . map ( selectedCells => selectedCells [ 1 ] = this . datamanager . rowViewOrder [ selectedCells [ 1 ] ] )
407
+ }
398
408
return cells ;
399
409
}
400
410
0 commit comments