Kendo Grid Filter : kendoGridFilterMenuTemplate should allow to set min length for filter

1 Answer 536 Views
Grid
karan
Top achievements
Rank 1
karan asked on 26 Aug 2021, 02:55 AM | edited on 26 Aug 2021, 02:56 AM

Kendo Grid Filter : kendoGridFilterMenuTemplate should allow to set min length for filter. For example , I need to do filter only when if user enters min 3 chrachters.

How can we achieve this?

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 30 Aug 2021, 04:26 PM

Hi Karan,

In general, when a FilterMenuTemplateDirective is used while creating filters, the developer can place whatever satisfies the given use-case scenario inside it. Including a Kendo TextBox, as I'd suggest in this particular case.

Then the dev would have control over the input and can add whatever limitations are deemed necessary. So, if the developer wants to prevent the filter from triggering when the number of characters in the input is <= 3, then this can be done inside the filterChange method.

Please take a look at the demo I've prepared: https://stackblitz.com/edit/angular-kvm161-napdtc?file=app%2Fapp.component.ts

Placing a TextBox component or a regular HTML input field also allows to limit the characters that can be entered by the user with the following properties:

Kendo TextBox - https://www.telerik.com/kendo-angular-ui/components/inputs/api/TextBoxComponent/#toc-maxlength

Regular input - https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength

The purpose of the example is to steer you in the right direction. Please keep in mind that further modifications may be required to adjust the example to suite the specific use-case scenario. Indeed the example isn't fully tested and should be used at the developer's own discretion.

I hope the information provided helps and steers you in the right direction.

Regards,
Silviya
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/.

Tags
Grid
Asked by
karan
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or