Is there any api to know if the data is being filtered or sorted ? #5922
-
lets say, i am showing 1000 rows in my table and when i am changing filter state or sort state it is taking some time to do the job. Meanwhile I want to show some loader. but I couldn't find any reliable api to use as loading state. There should be state that is true when the data is being filtered and after the filtering is done it should be false,, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Client-side filtering/sorting is sync, there is not really a If you are filtering/sorting remote data with a backend, you can handle the pending state from your app state side |
Beta Was this translation helpful? Give feedback.
Client-side filtering/sorting is sync, there is not really a
pending
state. You may are able to emulate a loading state via chrome-only api postTask or using raf/setTimeout/queueMicrotask. However since this still happen in main-thread depending on how slow the function is, the ui will be blocked (depending on how much data to render you have you'll notice it with a simple typehead, you may have to bind for example thechange
event for filtering)If you are filtering/sorting remote data with a backend, you can handle the pending state from your app state side