perbaikan master building
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="modal-header" style="background-color: #000000 !important">
|
||||
<h4 class="modal-title" style="color: #ffffff">Add New Row</h4>
|
||||
<h4 class="modal-title" style="color: #ffffff">{{labelModal}}</h4>
|
||||
<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
@@ -95,7 +95,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="statusId" style="color: #ffffff">Status:</label>
|
||||
<select
|
||||
id="projectinput5"
|
||||
id="statusId"
|
||||
class="form-control"
|
||||
formControlName="statusId"
|
||||
[ngClass]="{'is-invalid': myForm.get('statusId').invalid && myForm.get('statusId').touched}"
|
||||
|
||||
@@ -18,7 +18,7 @@ export class AddEditMasterBuildingComponent {
|
||||
dataStatus: any[];
|
||||
filteredDataStatus: any[];
|
||||
dataMasterStatus: any;
|
||||
|
||||
labelModal: any;
|
||||
constructor(
|
||||
public activeModal: NgbActiveModal,
|
||||
private fb: FormBuilder,
|
||||
@@ -30,7 +30,11 @@ export class AddEditMasterBuildingComponent {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.createForm();
|
||||
this.listDataStatus();
|
||||
|
||||
if (this.mode === "add") {
|
||||
this.labelModal = "Add Row"
|
||||
} else {
|
||||
this.labelModal = "Edit Row"
|
||||
}
|
||||
if (this.dataRow) {
|
||||
this.editForm();
|
||||
}
|
||||
@@ -52,7 +56,7 @@ export class AddEditMasterBuildingComponent {
|
||||
this.myForm = this.fb.group({
|
||||
id: this.dataRow.id,
|
||||
name: [this.dataRow.name, Validators.required],
|
||||
statusId: [this.dataRow.statusId, Validators.required],
|
||||
statusId: [this.dataRow.status_id, Validators.required],
|
||||
email: [this.dataRow.email, [Validators.required, Validators.email]],
|
||||
owner: [this.dataRow.owner, Validators.required],
|
||||
address: [this.dataRow.address, Validators.required],
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
</ng-template>
|
||||
</ngx-datatable-column>
|
||||
<ngx-datatable-column
|
||||
name="statusId"
|
||||
name="StatusName"
|
||||
[flexGrow]="1"
|
||||
[minWidth]="90"
|
||||
>
|
||||
@@ -151,7 +151,7 @@
|
||||
let-value="value"
|
||||
>
|
||||
<p style="color: #ffffff">
|
||||
{{ value === 2 ? "Aktif" : "Nonaktif" }}
|
||||
{{ value }}
|
||||
</p>
|
||||
</ng-template>
|
||||
</ngx-datatable-column>
|
||||
|
||||
@@ -74,6 +74,8 @@ export class MasterBuildingComponent {
|
||||
openAddMasterModal() {
|
||||
const modalRef = this.modalService.open(AddEditMasterBuildingComponent, {
|
||||
size: "lg",
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
});
|
||||
|
||||
modalRef.componentInstance.mode = "add";
|
||||
|
||||
Reference in New Issue
Block a user