remove only unsaved filter if no unsaved rows

master
Max Ehrlicher-Schmidt 4 years ago
parent 4ac1156aa4
commit 969ae67650

@ -192,6 +192,13 @@ export class TableComponent implements AfterViewInit {
} }
} }
this.data.data = tempDataSource; this.data.data = tempDataSource;
setTimeout(() => {
if (this.countUnsavedRows() == 0 && this.filters.onlyUnsaved) {
this.filters.onlyUnsaved = false;
this.applyFilters();
}
});
}); });
this.dataService.loadTableData(); this.dataService.loadTableData();
@ -324,6 +331,10 @@ export class TableComponent implements AfterViewInit {
deleteNewObject(row: any) { deleteNewObject(row: any) {
this.data.data = this.data.data.filter((element) => row.id !== element.id); this.data.data = this.data.data.filter((element) => row.id !== element.id);
if (this.countUnsavedRows() == 0 && this.filters.onlyUnsaved) {
this.filters.onlyUnsaved = false;
this.applyFilters();
}
} }
create(row: any) { create(row: any) {

Loading…
Cancel
Save