New Data Tables Creation not working : 1402
This commit is contained in:
@@ -8,3 +8,8 @@ export const appTableData: { displayValue: string, value: string }[] = [
|
||||
{ displayValue: 'Product Loan', value: 'm_product_loan' },
|
||||
{ displayValue: 'Savings Product', value: 'm_savings_product' }
|
||||
];
|
||||
|
||||
export const entitySubTypeData: { displayValue: string, value: string }[] = [
|
||||
{ displayValue: 'Person', value: 'Person' },
|
||||
{ displayValue: 'Entity', value: 'Entity' },
|
||||
];
|
||||
|
||||
+11
-2
@@ -16,8 +16,8 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="40%">
|
||||
<mat-label>Application Table Name</mat-label>
|
||||
<mat-form-field fxFlex="20%">
|
||||
<mat-label>Entity Type</mat-label>
|
||||
<mat-select required formControlName="apptableName">
|
||||
<mat-option *ngFor="let appTable of appTableData" [value]="appTable.value">
|
||||
{{ appTable.displayValue }}
|
||||
@@ -28,6 +28,15 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex="20%" *ngIf="showEntitySubType">
|
||||
<mat-label>Entity SubType</mat-label>
|
||||
<mat-select formControlName="entitySubType">
|
||||
<mat-option *ngFor="let entitySubType of entitySubTypeData" [value]="entitySubType.value">
|
||||
{{ entitySubType.displayValue }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<div fxFlex="14%" class="multi-row-wrapper">
|
||||
<mat-checkbox labelPosition="before" formControlName="multiRow" class="multi-row">Multi Row</mat-checkbox>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@ import { MatTableDataSource } from '@angular/material/table';
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/** Data Imports */
|
||||
import { appTableData } from '../app-table-data';
|
||||
import { appTableData, entitySubTypeData } from '../app-table-data';
|
||||
|
||||
/** Custom Components */
|
||||
import { ColumnDialogComponent } from '../column-dialog/column-dialog.component';
|
||||
@@ -31,6 +31,8 @@ export class CreateDataTableComponent implements OnInit {
|
||||
dataTableForm: FormGroup;
|
||||
/** Application Table Data */
|
||||
appTableData = appTableData;
|
||||
entitySubTypeData = entitySubTypeData;
|
||||
showEntitySubType: boolean;
|
||||
/** Column Data */
|
||||
columnData: any[] = [];
|
||||
/** Data passed to dialog. */
|
||||
@@ -84,6 +86,9 @@ export class CreateDataTableComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.createDataTableForm();
|
||||
this.setColumns();
|
||||
this.dataTableForm.controls.apptableName.valueChanges.subscribe((value: any) => {
|
||||
this.showEntitySubType = (value === 'm_client');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +107,8 @@ export class CreateDataTableComponent implements OnInit {
|
||||
this.dataTableForm = this.formBuilder.group({
|
||||
'datatableName': ['', Validators.required],
|
||||
'apptableName': ['', Validators.required],
|
||||
'multiRow': ['']
|
||||
'multiRow': [false],
|
||||
'entitySubType': ['']
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user