Hi.
I have a Grid with a lot of data sets, possibly over 2000, even 10.000 or more a possible. When I add a filter to this Grid component, it is very slow to even show what I'm typing. So I would like to defer setting the filter until I stop typing and maybe even show a spinner until the filtering is done instead of just nothing happening and then suddenly showing the filtered data.
So the questions are:
- How can I defer setting the filter until I pause typing (maybe after 500 ms or so)?
- How can I show a spinner until filtering is done?
Thanks!
Greetings,
Bernd
Hello, Bernd.
For defer setting the filter until you pause typing I can suggest using setTimeout, however the exact approach will depend on your implementation. As for showing a spinner after filtering I can suggest using filtering in controlled mode and attaching the spinner after the onFilterChange is triggered. I can also recommend ensuring that custom cells are rendered outside of the main one in order to prevent re-rendering of the Grid which might cause the slow filtering. The Grid also has mechanisms for optimizing the performance which I can suggest:
In case the issue with defer setting and showing the spinner persists, can you please send me a runnable example which matches your implementation? This will enable me to modify it directly so that you can transfer the logic to your real world app.
Regards,
Filip