Kendo Grid Filter-menu - Only 1 Filter Criteria

1 Answer 119 Views
Grid
Fidencio
Top achievements
Rank 1
Fidencio asked on 17 Dec 2021, 07:41 PM

 

In the following snippet, for a single column, I am allowing only 1 filter criteria by setting [extra] to false.  My goal is to restring the filter to only allow 1 criteria.  Is it possible apply this for all columns in the grid without performing this action for each column?

<kendo-grid-column field="myDate" title="Title">
    <ng-template kendoGridFilterMenuTemplate
        let-filter let-column="column" let-filterService="filterService"> 

        <kendo-grid-date-filter-menu
          [column]="column" [filter]="filter" [filterService]="filterService"
          [extra]="false"
          operator="eq"
        >
        </kendo-grid-date-filter-menu>

    </ng-template>
</kendo-grid-column>

1 Answer, 1 is accepted

Sort by
0
Valentin
Telerik team
answered on 22 Dec 2021, 03:08 PM

Hi Fidencio,

Thank you for the provided code snippet.

One way to achieve the requirement is to render the columns with *ngFor. That approach will allow to define the kendoGridFilterMenuTemplate in one place and use it for all columns.

Please see the following example:

https://stackblitz.com/edit/angular-wnwzkv?file=app/app.component.ts

The example is used for a demonstration purpose in order to show how to use the same kendoGridFilterMenuTemplate for all columns, disregarding the actual column data types. Thus, the template will function properly only in the "First Ordered" column.

Unfortunately, there isn't a built-in feature that allows configuring the filter criteria for all columns from one place.

I hope the provided information will be useful.

Regards,
Valentin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Fidencio
Top achievements
Rank 1
commented on 23 Dec 2021, 05:23 PM

Valentin,

Valentin,

I had been looking for a built-in feature to configure the filter criteria for all columns, but you have confirmed that I will have to resolve my issue in a different way.  

Thank you for the response.  



Tags
Grid
Asked by
Fidencio
Top achievements
Rank 1
Answers by
Valentin
Telerik team
Share this question
or