fixed Syntax error when trying to sort by UUID column #895

This commit is contained in:
Jan Prochazka
2024-09-26 09:06:14 +02:00
parent 888f5c6260
commit a4872b4159
2 changed files with 15 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ export abstract class GridDisplay {
applySortOnSelect(select: Select, displayedColumnInfo: DisplayedColumnInfo) {
if (this.config.sort?.length > 0) {
select.orderBy = this.config.sort
const orderByColumns = this.config.sort
.map(col => ({ ...col, dispInfo: displayedColumnInfo[col.uniqueName] }))
.map(col => ({ ...col, expr: select.columns.find(x => x.alias == col.uniqueName) }))
.filter(col => col.dispInfo && col.expr)
@@ -286,6 +286,10 @@ export abstract class GridDisplay {
...col.expr,
direction: col.order,
}));
if (orderByColumns.length > 0) {
select.orderBy = orderByColumns;
}
}
}