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

OnStateChanged called twice while filtering

1 Answer 329 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
Ivan asked on 19 Dec 2020, 04:52 PM

Hello!
Is it normal that the grid's OnStateChanged event gets called twice when filtering?

Other actions, such as sorting, resizing, and reordering, call OnStateChanged once.
I have an event handler that stores the state of the grid in local storage, and it's rather annoying that it gets called twice for no reason.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Nadezhda Tacheva
Telerik team
answered on 22 Dec 2020, 05:12 PM

Hi Ivan,

Thank you for reaching out!

Indeed the OnStateChanged is being called twice on filter. It is a known bug and you can Follow it here.

I have added a vote on your behalf to increase its priority. In the meantime, you can click on the Follow button to receive email notifications on status changes (this is the best way to know when a bug is fixed. When we plan it for a certain release, we announce that information in the public feedback portal).

In the meantime, a couple of workarounds that you may try (also listed the post):

  • Check the last count of filter descriptors in the state to avoid the second call

  • Debounce the event - set a debounce time of X seconds and only have the grid filtered when the user stops typing

I hope you'll find the above information useful.

Regards,
Nadezhda
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
Ivan
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Nadezhda Tacheva
Telerik team
Share this question
or