custom grid display fix

This commit is contained in:
Jan Prochazka
2024-07-10 15:53:26 +02:00
parent befada8b87
commit cb0a11fda9
3 changed files with 15 additions and 7 deletions

View File

@@ -20,6 +20,8 @@ export interface CustomGridColumn {
}
export class CustomGridDisplay extends GridDisplay {
customColumns: CustomGridColumn[];
constructor(
public tableName: NamedObjectInfo,
columns: CustomGridColumn[],
@@ -35,6 +37,8 @@ export class CustomGridDisplay extends GridDisplay {
) {
super(config, setConfig, cache, setCache, driver, dbinfo, serverVersion);
this.customColumns = columns;
this.columns = columns.map(col => ({
columnName: col.columnName,
headerText: col.columnLabel,
@@ -63,12 +67,15 @@ export class CustomGridDisplay extends GridDisplay {
createSelect(options = {}) {
const select = this.createSelectBase(
this.tableName,
[],
// @ts-ignore
this.columns.map(col => ({
columnName: col.columnName,
})),
options
// this.columns.map(col => ({
// columnName: col.columnName,
// })),
options,
this.customColumns.find(x => x.isPrimaryKey)?.columnName
);
select.selectAll = true;
if (this.additionalcondition) {
if (select.where) {
select.where = {