inventory-items-2 #44
@ -27,7 +27,7 @@
|
||||
</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="delete">
|
||||
<th mat-header-cell *matHeaderCellDef> <button mat-icon-button><mat-icon>add</mat-icon></button> </th>
|
||||
<th mat-header-cell *matHeaderCellDef> <button mat-icon-button (click)="addItemgroupCharacteristic()"><mat-icon>add</mat-icon></button> </th>
|
||||
<td mat-cell *matCellDef="let element"><button mat-icon-button color="warn" (click)="deleteItemgroupCharacteristic(element)"><mat-icon>delete</mat-icon></button></td>
|
||||
</ng-container>
|
||||
|
||||
|
@ -3,6 +3,7 @@ import {ItemGroup} from "../../../project/game-model/inventory/ItemGroup";
|
||||
import {MatColumnDef, MatTable, MatTableDataSource} from "@angular/material/table";
|
||||
import {ItemQuality} from "../../../project/game-model/inventory/ItemQuality";
|
||||
import {ItemGroupCharacteristic} from "../../../project/game-model/inventory/ItemgroupCharacteristic";
|
||||
import {Item} from "../../../project/game-model/inventory/Item";
|
||||
|
||||
@Component({
|
||||
selector: 'app-item-group-editor',
|
||||
@ -36,4 +37,11 @@ export class ItemGroupEditorComponent implements OnInit{
|
||||
finishEditing() {
|
||||
this.editedCharacteristic = undefined;
|
||||
}
|
||||
|
||||
addItemgroupCharacteristic() {
|
||||
const itemgroupCharacteristic = new ItemGroupCharacteristic("", "");
|
||||
this.itemgroup!.itemGroupCharacteristics.push(itemgroupCharacteristic);
|
||||
this.itemQualityDatasource.data = this.itemgroup!.itemGroupCharacteristics;
|
||||
this.editedCharacteristic = itemgroupCharacteristic;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user