Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Custom filterCellTemplate with select
posted

Hey guys,

thank you for your great work!

Currently, I couldn't manage to build a column filter with a dropdown as a selection. In my case, it's needed, because the user is only allowed to select some specific keywords. Is there any sample? I just found a custom date filter here: https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/filtering#re-templating-filter-cell 

Here is the current approach (not working) with A and B as input samples:

<ng-template #enumFilterTemplate igxFilterCellTemplate let-column="column">
<div class="filter-cell">
<igx-input-group #inputGr [displayDensity]="'compact'" class="filter-input" type="box">
<igx-prefix>
<igx-icon>search</igx-icon>
</igx-prefix>
<select
#enumFilter
(click)="setFocusOnFilter(inputGr)"
(input)="onFilterInput(enumFilter, column, 'equals')"
(keydown)="onFilterKeyDown($event)"
[value]="getFilterValue(column, 'equals')"
autocomplete="off"
tabindex="0">
<option>A</option>
<option>B</option>
</select>
<igx-suffix ()="clearFilterInput(column)" *ngIf="enumFilter.value" tabindex="0">
<igx-icon>clear</igx-icon>
</igx-suffix>
</igx-input-group>
</div>
</ng-template>