form view infrastructure, loading row from DB

This commit is contained in:
Jan Prochazka
2021-01-09 20:37:49 +01:00
parent bb35a496f8
commit b71b58c93f
10 changed files with 250 additions and 36 deletions

View File

@@ -518,4 +518,20 @@ export abstract class GridDisplay {
conditions,
};
}
switchToFormView(rowData) {
if (!this.baseTable) return;
const { primaryKey } = this.baseTable;
if (!primaryKey) return;
const { columns } = primaryKey;
this.setConfig((cfg) => ({
...cfg,
isFormView: true,
formViewKey: _.pick(
rowData,
columns.map((x) => x.columnName)
),
}));
}
}