Walaa, I think that won't work as the skip value has to be a multiple of take as we have a pagesize/number paging system, not a skip / take paging system
It was indeed my idea as well more or less, but indeed, it won't work in all cases.
The current system is a bit problematic, as you can't skip n and take m rows if n isn't a multiple of m, as the api expects a page size and a page number. To add that we need yet more parameters and overloads, as everything has to stay backwards compatible.
In this case, it's not a big problem though:
- fetch the total count, which is N
- then simply page through the set with page size S.
- you display 'more rows available' if N > (S * pagenumber).
Now, the argument that there might be more rows added or rows removed during the paging action is also true for whether you pull the count each time: Say that's the case, you get the count each time you fetch a page: you get the last page and the count is (pagesize*pagenumber). However when the page is displayed, someone adds a row. Then it's not valid too.
I've looked into adding skipping into the framework without adding any overloads, but it always felt like a bit of a hack, e.g. use the maxNumberOfElementsToReturn as the take value and pagenumber as the # to skip, and go into this mode if pagesize is 0. (or something like that). Though as we now have two modern query api's, it might be time to add this, or add yet another overload which accepts a single object with parameters.
We might have to do that anyway with new features added to v4