Ajout d'une zone de filtre sur les DZs

This commit is contained in:
Sébastien André
2021-03-30 14:50:52 +02:00
parent b8eda2f0d7
commit 64c6481023
2 changed files with 10 additions and 0 deletions

View File

@@ -2,6 +2,11 @@
<div *ngIf="dataSourceTable != null else loading">
<button mat-raised-button color="accent" (click)="openDialogToAdd()" *ngIf="isUserAdmin == true">Add a drop zone</button>
<mat-form-field>
<mat-label>Filter</mat-label>
<input matInput (keyup)="applyFilter($event)" placeholder="Filter on the name or address of center" #input>
</mat-form-field>
<table mat-table [dataSource]="dataSourceTable">
<ng-container matColumnDef="isfavorite">
<th mat-header-cell *matHeaderCellDef style="min-width: 144px;"></th>

View File

@@ -79,4 +79,9 @@ export class ListOfDzsComponent implements OnInit {
width: '600px',
});
}
applyFilter(event: Event) {
const filterValue = (event.target as HTMLInputElement).value;
this.dataSourceTable.filter = filterValue.trim().toLowerCase();
}
}