mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Form renderer enhancements (#1839)
- readonly mode for “Dynamic Table” - “Display Value” now just uses “Dynamic Table” if needed (previously rendered the table itself) - support for “tableEditable” settings
This commit is contained in:
committed by
Mario Romano
parent
95711616ca
commit
1dd283b0d8
@@ -54,9 +54,9 @@ export class DynamicTableModel extends FormWidgetModel {
|
||||
this.field = field;
|
||||
|
||||
if (field.json) {
|
||||
|
||||
if (field.json.columnDefinitions) {
|
||||
this.columns = field.json.columnDefinitions.map(obj => <DynamicTableColumn> obj);
|
||||
const columns = this.getColumns(field);
|
||||
if (columns) {
|
||||
this.columns = columns;
|
||||
this.visibleColumns = this.columns.filter(col => col.visible);
|
||||
}
|
||||
|
||||
@@ -72,6 +72,20 @@ export class DynamicTableModel extends FormWidgetModel {
|
||||
];
|
||||
}
|
||||
|
||||
private getColumns(field: FormFieldModel): DynamicTableColumn[] {
|
||||
if (field && field.json) {
|
||||
let definitions = field.json.columnDefinitions;
|
||||
if (!definitions && field.json.params && field.json.params.field) {
|
||||
definitions = field.json.params.field.columnDefinitions;
|
||||
}
|
||||
|
||||
if (definitions) {
|
||||
return definitions.map(obj => <DynamicTableColumn> obj);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
flushValue() {
|
||||
if (this.field) {
|
||||
this.field.value = this.rows.map(r => r.value);
|
||||
|
Reference in New Issue
Block a user