This commit is contained in:
parent
eae55eb49c
commit
2b83650348
@ -6,13 +6,20 @@
|
|||||||
|
|
||||||
<ng-container matColumnDef="value">
|
<ng-container matColumnDef="value">
|
||||||
<th mat-header-cell *matHeaderCellDef>Value</th>
|
<th mat-header-cell *matHeaderCellDef>Value</th>
|
||||||
<td mat-cell *matCellDef="let characteristicValue">{{characteristicValue.value}}</td>
|
<td mat-cell *matCellDef="let characteristicValue">
|
||||||
|
<span *ngIf="characteristicValue !== editedItemgroupCharacteristicValue">{{characteristicValue.value}}</span>
|
||||||
|
<mat-form-field appearance="outline" style="width: 100%;" *ngIf="characteristicValue === editedItemgroupCharacteristicValue">
|
||||||
|
<mat-label>Value</mat-label>
|
||||||
|
<input matInput [(ngModel)]="characteristicValue.value">
|
||||||
|
</mat-form-field>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="edit">
|
<ng-container matColumnDef="edit">
|
||||||
<th mat-header-cell *matHeaderCellDef></th>
|
<th mat-header-cell *matHeaderCellDef></th>
|
||||||
<td mat-cell *matCellDef="let characteristicValue">
|
<td mat-cell *matCellDef="let characteristicValue">
|
||||||
<button mat-icon-button><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button *ngIf="editedItemgroupCharacteristicValue == undefined" (click)="editCharacteristicValue(characteristicValue)"><mat-icon>edit</mat-icon></button>
|
||||||
|
<button mat-icon-button *ngIf="editedItemgroupCharacteristicValue != undefined" (click)="finishEditing()" [disabled]="characteristicValue !== editedItemgroupCharacteristicValue"><mat-icon>done</mat-icon></button>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
|
|||||||
|
|
||||||
datasource: MatTableDataSource<ItemgroupCharacteristicValue> = new MatTableDataSource<ItemgroupCharacteristicValue>();
|
datasource: MatTableDataSource<ItemgroupCharacteristicValue> = new MatTableDataSource<ItemgroupCharacteristicValue>();
|
||||||
displayedColumns: string[] = ['characteristic', 'value', 'edit']
|
displayedColumns: string[] = ['characteristic', 'value', 'edit']
|
||||||
|
editedItemgroupCharacteristicValue: ItemgroupCharacteristicValue | undefined
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.item!.initializeItemCharacteristics();
|
this.item!.initializeItemCharacteristics();
|
||||||
@ -30,4 +31,12 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
|
|||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editCharacteristicValue(itemCharacteristicValue: ItemgroupCharacteristicValue): void {
|
||||||
|
this.editedItemgroupCharacteristicValue = itemCharacteristicValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
finishEditing() {
|
||||||
|
this.editedItemgroupCharacteristicValue = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user