Hi, how can I get and use the number of items in a data grid currently displayed on the page (not the total amount of items in a collection)? Do they get stored in some variable?
I don’t use the backend filtering and don’t want to fetch a collection each time a user changes filters or uses search (I have less then 100 records, so it wouldn’t make sense, also from the UX perspective).
I’ve found this topic in the community: Number of filtered items - #2 by Joyce but can’t apply this to my case. Chatting with the copilot gave no results.
Hi @Joyce , thank you for your answer!
Unfortunately, it doesn’t help. When I moved the filtering from the data grid to the collection level, the dynamic frontend filtering that I previously had stopped working. To make it work and to display the total of items after the filter - now I need to refetch the collection every time a user applies filters. But it’s the same as having the backend filtering, because I need to send a request to a server each time a user changes values in the fields.
If I understood correctly from my previous research and from your answer, if I want to show the total after the filtering, then I must refetch the collection. So I’ll consider adding the “Aplly filters” button to make it more user-friendly.