Ajout d'une zone de filtre sur les DZs
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user