Welcome to the React feedback portal. We’re happy you’re here! If you have feedback on how to improve the React, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Not sure if this is a bug or maybe a bit of feature. We call them fugs at my job :)
Anyways trying to implement a count(distinct value) aggregate via custom aggregate. The user case is something like.... I want to search a product database that has sales persons assigned to each product. The end users uses the free text search for say something like "fronzen.". This limits the number of products to 800. Within that 800 only 5 sales reps are associated with those 800 product. If I just do a count I get 800 to match the product, not the 5 distinct sales reps that match the ad-hoc search/filter/etc.
My page size is 25 rows. So the custom aggregate function only returns 25 rows. I get a total count, but that won't really help me since I need to scan the entire filtered data set looking for rows.
I can reference the full JSON data array for my set when the aggregate fires for the most part, but it gets a little weird when searching and/or filtering come into play.
I've mucked around with Grid.getDataModule().executeQuery(generateQuery()); which returns a promise and also seems to still query the 25 rows. So i'm kind of at a loss. Only so much I can glean from the browser's debugger.
The work around will probably be to simulate as close as possible the filters and search by JSON array by hand, but I fear I'll never quite get the 2 to line up. I just can't seem to find anything in the API that gives me the current filtered data set that matches the count you see at the bottom the Pager control. getFilteredRecords returns an empty array...but maybe I'm doing that wrong.
I'd also like grouping aggregates. I've been able to largely reverse engineer how the custom and when the custom aggregate functions get called in all these cases, but the page limit comes up.
I've noticed some other posts talking about creating global aggregates and I wonder if that is the way to go, but I just can't seem to find concrete docs on that in the React docs specifically. I'm happy to associate a aggregate function globally as those seem to be built into the dataManager, dataSource, executeQuery paradigm in your codebase.
Overall I'm really enjoying the data grid and I can appreciate just how difficult it is to handle all these cases/permutations.