Skip to content

Commit

Permalink
fix: try adding sort icon on non sortable column shouldn't throw
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding-SE committed Nov 24, 2023
1 parent 1be1d72 commit 4791fc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/common/src/core/slickGrid.ts
Expand Up @@ -2819,12 +2819,14 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
const column = this.getColumnByIndex(columnIndex);
if (column) {
column.classList.add('slick-header-column-sorted');
let indicator = column.querySelector('.slick-sort-indicator') as HTMLElement;
indicator.classList.add(col.sortAsc ? 'slick-sort-indicator-asc' : 'slick-sort-indicator-desc');
let indicator = column.querySelector('.slick-sort-indicator');
indicator?.classList.add(col.sortAsc ? 'slick-sort-indicator-asc' : 'slick-sort-indicator-desc');

if (numberCols) {
indicator = column.querySelector('.slick-sort-indicator-numbered') as HTMLElement;
indicator.textContent = String(i);
if (indicator) {
indicator.textContent = String(i);
}
}
}
}
Expand Down

0 comments on commit 4791fc8

Please sign in to comment.