ng-material-extensions
ng-material-extensions copied to clipboard
how to filter with multiple values for single column?
how to filter with multiple values for the single column? Is it possible? does this functionality already exist?.
My Scenario:
I want to use a mat multi-select for a grid column filter, I want to be able to select multiple values and filter the grid based on the selection. currently, when I'm trying to do that it's not returning any data.
can you help me..?
This case is not out-of-the-box covered because the filter entity is supposed to map the entities listed in the table. However you can achieve what you want with a custom property filtering like below.
**HTML**
<mat-table matTableFilter [exampleEntity]="filterEntity" [propertyOptions]="propertyOptions"
[filterType]="filterType" [dataSource]="dataSource" class="mat-elevation-z8">
**TS**
this.propertyOptions = {yourProperty: (item: string) => { // Custom filtering for yourProperty
return this.yourArrayOfSelections.includes(item);
}};