For filtering we are using the kendo data query "process" library. The issue is that when you combine this with paging, there are issues with determining the total number of items since "process" returns an array only of your page size.
So I essentially have to run "process" twice:
1. So I can get the filtered and paged data
2. Again with just the filter parameters so I can get how many total items are in the set after filters have been applied
For example:
loadItems() { const myData: any = []; //Some data in here let gs: State = { skip: 0, take: 10, filter: { //Some filter data } as CompositeFilterDescriptor };
//THis will filter my data, then return the paged slice of it let gd: GridDataResult = process(myData, gs);
//This will run just the filter so I can get the total items gd.total = process(myData, {filter: gs.filter} as State).data.length; }
Is there a better way to get the total number of filtered items when I am also using paging instead of having to run "process" twice? I have thought about extending the "process" so I can add an extra field on it with total entries but not sure how to get started.
Any assistance would be appreciated.