Disable few filters from default kendo grid filters angular

603 views Asked by At

I have a kendo grid in angular that has [filterable]= "menu". But we need to only show only a few options for the column filtering e.g. Contains, and equal to. Currently, there are 8 different options like not empty, starts with, ends with , contains, etc.

How can we override these and show:

  1. String: Contains, Equal To
  2. Numeric: Greater than , Equal

Can we see only these mentioned filter options for the string and numeric data type respectively for angular grid.

1

There are 1 answers

0
topalkata On

You can utilize the FilterMenuTemplateDirective and the built-in filter menu components, and set the desired list of filter operators:

https://www.telerik.com/kendo-angular-ui-develop/components/grid/filtering/filter-menu/#toc-built-in-filter-menu-components

https://www.telerik.com/kendo-angular-ui-develop/components/grid/filtering/filter-menu/#toc-order-of-filter-operators

<kendo-grid-column field="ProductName" title="Product Name">
    <ng-template kendoGridFilterMenuTemplate let-filter let-column="column" let-filterService="filterService">
        <kendo-grid-string-filter-menu
            [column]="column"
            [filter]="filter"
            [filterService]="filterService">
                <kendo-filter-contains-operator></kendo-filter-contains-operator>
                <kendo-filter-eq-operator></kendo-filter-eq-operator>
        </kendo-grid-string-filter-menu>
    </ng-template>
</kendo-grid-column>