This is a migrated thread and some comments may be shown as answers.

Grid Filter DataStateChange event responsive

1 Answer 1470 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 09 Dec 2019, 03:48 PM

I am not sure what it is called so I will instead attempt to describe the behavior I am seeking in order to ask my question. 

It seems that the default filter implementation fires the dataStateChange event every time you type in the filter field. So example, if I have a city column in a grid with a default string filter and I begin to type the letter "A" for the city of Atlanta the dataStateChange event is immediately fired and then fires for each keystroke afterwards. This is an issue since we are attempting to figure out how to perform our filtering server side by passing the filters in a query string to a web api operation. I want to be able to allow the user to input say the entire text for the city of Atlanta before firing a dataStateChange event. If this is not an option I would like to be able to some how hold the response until the user clicks a filter button.  

I remember in the previous version of KendoUI for jQuery that we had filters that were inline of the column and had a filter button and a clear button. So you could type the full city for instance and then click filter. Are these still available and if so can you point me to any example code. 

I have attached an image to show what I am talking about.

1 Answer, 1 is accepted

Sort by
0
Hetali
Telerik team
answered on 10 Dec 2019, 08:55 PM

Hi Nathan,

Thank you for the description and the image.

We have a dedicated Filter Menu in the Kendo UI Grid to achieve the desired filter option.

Furthermore, you can edit the Filter Menu using the FilterMenuTemplateDirective and based on the column type use either of the following ready-to-use components:

As seen in the image, to remove the second criteria you can set the extra property to false. For example:

<kendo-grid filterable="menu">
  <kendo-grid-column field="ProductName" title="Name">
    <ng-template kendoGridFilterMenuTemplate let-filter let-filterService="filterService" let-column="column">
      <kendo-grid-string-filter-menu
        [column]="column"
        [filter]="filter"
        [filterService]="filterService"
        [extra]="false">
      </kendo-grid-string-filter-menu>
    </ng-template>
  </kendo-grid-column>
</kendo-grid>

In this StackBlitz example, I have used a String Filter Menu and a Numeric Filter Menu in the Kendo UI Grid which works as per your requirement.

Please let me know if this helps or if you have any further questions pertaining to the Filter Menu in the Kendo UI Grid.

Regards,
Hetali
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Nathan
Top achievements
Rank 1
Answers by
Hetali
Telerik team
Share this question
or