mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
custom grid display fix
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user