Improve filters

urls
Max Ehrlicher-Schmidt 4 years ago
parent fee2eb4bca
commit 1835967da9

@ -188,7 +188,7 @@
class="button-wrapper" class="button-wrapper"
*ngIf="element.newObject" *ngIf="element.newObject"
[matTooltip]=" [matTooltip]="
'Nicht ausgefüllte Felder: ' + countUnvalidFields(element) 'Nicht ausgefüllte Pflichtfelder (rot): ' + countUnvalidFields(element)
" "
> >
<button <button

@ -284,7 +284,7 @@ export class BikesComponent {
addNewObject() { addNewObject() {
this.paginator.firstPage(); this.paginator.firstPage();
this.resetFilter(); this.setFilter({...this.filter, includesString: ""});
this.resetSorting(); this.resetSorting();
this.data.data = [ this.data.data = [
{ newObject: true, id: this.getNewId() }, { newObject: true, id: this.getNewId() },
@ -382,6 +382,7 @@ export class BikesComponent {
showOnlyUnsavedElements(value: boolean) { showOnlyUnsavedElements(value: boolean) {
this.filter.onlyUnsaved = value; this.filter.onlyUnsaved = value;
this.filter.includesString = "";
this.applyFilter(); this.applyFilter();
} }
@ -392,8 +393,8 @@ export class BikesComponent {
} as unknown) as string; } as unknown) as string;
} }
resetFilter() { setFilter(filterObject) {
this.filter = this.initialFilter; this.filter = filterObject;
this.applyFilter(); this.applyFilter();
} }

Loading…
Cancel
Save