Skip to content

Commit

Permalink
Fix s-table sorting error
Browse files Browse the repository at this point in the history
ref: #2766

- When an s-table was set to sort by a column which was created by
  a plugin, and then the plugin was disabled, the error would occur
  after a page reload.
  • Loading branch information
stickz committed Oct 27, 2024
1 parent da5501c commit 690062d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/stable.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,8 @@ dxSTable.prototype.Sort = function(e)
}
return(true);
}
const oldCol = primarySorting ? this.tHeadCols[this.getColNoById(this.sortId)] : null;
const sortColNo = this.getColNoById(this.sortId);
const oldCol = primarySorting ? this.tHeadCols[(sortColNo >= 0) ? sortColNo : 0] : null;
const col = e ? e.delegateTarget : oldCol;
const sortIdCurrent = this.getIdByCol(this.colOrder[parseInt(col.getAttribute("index"))]) ?? '';
const toggleReverse = (oldId, oldRev) => (oldId === sortIdCurrent) ? 1 - oldRev : 0;
Expand Down

0 comments on commit 690062d

Please sign in to comment.