Kendo React - External filter - Delay onChange while typing in the first DropDownList

1 Answer 57 Views
DropDownList Filter  Grid
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Jason asked on 12 Jan 2024, 08:27 PM

Greetings,

I found out that the External filter allows the user to type in the first DropDownList to search for the column name before selecting it.
Is it possible to change the first DropDownList onChange function to delay an action until the user stops typing before triggering the search?

Please help, thanks!

 

Jason

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 16 Jan 2024, 04:16 PM

Hi, Jason,

By default, the `onChnage` event of the filter is triggered only on first key press or when the user is navigating through the items via the arrow keys. If it will be applicable to your scenario, you can add the desired timeout around the `setFilter` call, but this will slow down the highlighting of the target item as well:

  const onFilterChange = (event: FilterChangeEvent) => {
    setTimeout(() => setFilter(event.filter), 1000);
  };

You can see a sample illustrating this approach in the - https://stackblitz.com/edit/react-frxexq-mkctyb?file=app%2Fmain.tsx 

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
DropDownList Filter  Grid
Asked by
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or