Skip to content

Commit

Permalink
Fix: Tweak setupColumnSort() to fix exception when col no longer exis…
Browse files Browse the repository at this point in the history
…ts (#1016)

* fix: Tweak setupColumnSort() to fix exception when a no longer existing column is in the sort list. Fixes #1015

* fix: also skip hidden columns in sort
  • Loading branch information
6pac committed May 7, 2024
1 parent 24fa702 commit 768e240
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1801,8 +1801,9 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
multiColumnSort: true,
previousSortColumns,
sortCols: this.sortColumns.map((col) => {
return { columnId: this.columns[this.getColumnIndex(col.columnId)].id, sortCol: this.columns[this.getColumnIndex(col.columnId)], sortAsc: col.sortAsc };
})
const tempCol = this.columns[this.getColumnIndex(col.columnId)];
return !tempCol || tempCol.hidden ? null : { columnId: tempCol.id, sortCol: tempCol, sortAsc: col.sortAsc };
}).filter((el) => el)
};
}

Expand Down

0 comments on commit 768e240

Please sign in to comment.