main #48
@ -6,13 +6,20 @@
 | 
			
		||||
 | 
			
		||||
  <ng-container matColumnDef="value">
 | 
			
		||||
    <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 matColumnDef="edit">
 | 
			
		||||
    <th mat-header-cell *matHeaderCellDef></th>
 | 
			
		||||
    <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>
 | 
			
		||||
  </ng-container>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,7 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
 | 
			
		||||
 | 
			
		||||
  datasource: MatTableDataSource<ItemgroupCharacteristicValue> = new MatTableDataSource<ItemgroupCharacteristicValue>();
 | 
			
		||||
  displayedColumns: string[] = ['characteristic', 'value', 'edit']
 | 
			
		||||
  editedItemgroupCharacteristicValue: ItemgroupCharacteristicValue | undefined
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.item!.initializeItemCharacteristics();
 | 
			
		||||
@ -30,4 +31,12 @@ export class InheritedItemCharacteristicEditorComponent implements OnInit{
 | 
			
		||||
    }
 | 
			
		||||
    return []
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  editCharacteristicValue(itemCharacteristicValue: ItemgroupCharacteristicValue): void {
 | 
			
		||||
    this.editedItemgroupCharacteristicValue = itemCharacteristicValue;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  finishEditing() {
 | 
			
		||||
    this.editedItemgroupCharacteristicValue = undefined;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user