|
|
|
@ -149,6 +149,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
setColumns(data) {
|
|
|
|
|
this.columnDefs = data.map(x => {
|
|
|
|
|
x.editable = !this.readonly;
|
|
|
|
|
x.minWidth = 150;
|
|
|
|
|
|
|
|
|
|
// Set editors and renderers for different types
|
|
|
|
|
if ( x.Type === 'text' ) {
|
|
|
|
@ -160,6 +161,7 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
} else if ( x.Type === 'boolean' ) {
|
|
|
|
|
x.cellRendererFramework = BooleanRendererComponent;
|
|
|
|
|
x.cellEditorFramework = BooleanEditorComponent;
|
|
|
|
|
x.suppressSizeToFit = true;
|
|
|
|
|
} else if ( x.Type === 'select' ) {
|
|
|
|
|
x.cellEditorFramework = SelectEditorComponent;
|
|
|
|
|
} else if ( x.Type === 'multiselect' ) {
|
|
|
|
@ -172,6 +174,9 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
x.cellRendererFramework = CurrencyRendererComponent;
|
|
|
|
|
} else if ( x.Type === 'index' ) {
|
|
|
|
|
x.editable = false;
|
|
|
|
|
x.suppressSizeToFit = true;
|
|
|
|
|
x.width = 80;
|
|
|
|
|
x.minWidth = 80;
|
|
|
|
|
} else if ( x.Type === 'wysiwyg' ) {
|
|
|
|
|
x.cellEditorFramework = WysiwygEditorComponent;
|
|
|
|
|
}
|
|
|
|
@ -181,10 +186,15 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
|
|
|
|
|
|
|
|
|
|
this.agGridElement.api.setColumnDefs([]);
|
|
|
|
|
this.agGridElement.api.setColumnDefs(this.columnDefs);
|
|
|
|
|
this.agGridElement.api.sizeColumnsToFit();
|
|
|
|
|
this.dirty = true;
|
|
|
|
|
this.editorService.triggerSave();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public onResized() {
|
|
|
|
|
this.agGridElement.api.sizeColumnsToFit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async performLoad(): Promise<void> {
|
|
|
|
|
if ( !this.node.Value ) {
|
|
|
|
|
this.node.Value = {};
|
|
|
|
|