Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2ff862c

Browse files
committed
fix: make selection work for all columns
1 parent 04aaa98 commit 2ff862c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/cellmanager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ export default class CellManager {
360360

361361
colIndex1 = +cell1.colIndex;
362362
colIndex2 = +cell2.colIndex;
363-
if (this.datamanager.getColumn(colIndex1).sortOrder !== 'none' ||
364-
this.datamanager.getColumn(colIndex2).sortOrder !== 'none') {
365-
sortedColumn = true;
363+
364+
if (this.columnmanager.sortState) {
365+
this.sortedColumn = true;
366366
rowIndex1 = this.datamanager.rowViewOrder.indexOf(parseInt(cell1.rowIndex, 10));
367367
rowIndex2 = this.datamanager.rowViewOrder.indexOf(parseInt(cell2.rowIndex, 10));
368368
} else {
@@ -401,7 +401,7 @@ export default class CellManager {
401401
}
402402
colIndex = colIndex1;
403403
});
404-
if (sortedColumn) {
404+
if (this.columnmanager.sortState) {
405405
cells.forEach(selectedCells => {
406406
selectedCells[1] = this.datamanager.rowViewOrder[selectedCells[1]];
407407
});

src/columnmanager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ export default class ColumnManager {
386386
const columnsToSort = Object.values(sortingConfig);
387387
for (let column of columnsToSort) {
388388
this.sortColumn(column.colIndex, column.sortOrder);
389+
this.sortState = true
389390
}
390391
}
391392
}

0 commit comments

Comments
 (0)