Api umgebaut
This commit is contained in:
@@ -79,7 +79,7 @@ export class AgKeyActionsComponent implements ICellRendererAngularComp {
|
||||
})
|
||||
).subscribe({
|
||||
next: () => {
|
||||
this.setData();
|
||||
this.api.refreshKeys();
|
||||
},
|
||||
error: () => {
|
||||
this.params.api.setGridOption("loading", false);
|
||||
@@ -99,6 +99,7 @@ export class AgKeyActionsComponent implements ICellRendererAngularComp {
|
||||
if (n != null) {
|
||||
this.key.handedOut = n;
|
||||
this.params.api.refreshCells();
|
||||
this.api.refreshKeys();
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -111,24 +112,17 @@ export class AgKeyActionsComponent implements ICellRendererAngularComp {
|
||||
maxWidth: '100vw',
|
||||
maxHeight: '100vh'
|
||||
}).afterClosed().subscribe({
|
||||
next: n => {
|
||||
next: async n => {
|
||||
if (n != null) {
|
||||
if (n == "") {
|
||||
n = null;
|
||||
}
|
||||
this.key.keyLost = n;
|
||||
this.params.api.refreshCells();
|
||||
this.api.updateKey(this.key).subscribe();
|
||||
this.setData();
|
||||
await this.api.updateKey(this.key).subscribe();
|
||||
this.api.refreshKeys();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private setData() {
|
||||
let data = this.params.api.getGridOption("rowData");
|
||||
data = data?.filter(d => d.id != this.key.id);
|
||||
this.params.api.setGridOption("rowData", data);
|
||||
this.params.api.setGridOption("loading", false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user