-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use page and size while creating datasource #46
Comments
Hey, thanks for the issue! The Datasource.get method has only index-count signatures. But you can implement pages logic as an intermediate layer between the Datasource (uiScroll) and the Remote (server data). Something like
With this approach we do some extra work and should throw away items that are out of real index-count scope (
There are many ways and things that could be done: page size can differ from the Datasource.get count parameter (which is bufferSize setting), also, you may take into the account max page number value etc. Datasource.get method implementation could be very flexible and complicated, I hope I was able to reflect the idea of additional layer within the "get" method. |
@dhilt have you considered adding a minIndex setting at one point? |
@MasterToney Sure! I understand the need and AngularJS version had such a setting. It would be nice if you create a separate issue for minIndex setting, because this one will be closed (I hope). |
Hey, thanks for the explanation. Was able to get it working (sort of) with your code and you can close the issue if you want. Thanks for the reply. |
Hi,
My api is build using the params page and size , so I can do something like page 1 and size 10 to get elements 11 to 20. I was wondering if I could create a datasource with those params or is it fixed to index and count ?
The text was updated successfully, but these errors were encountered: