-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Skip x entries instead of requesting pages #50
Comments
are u saying the first 5 posts are skipped? What does There's a starting page parameter in ember infinity, I'd recommend you use that if possible |
I can't control the backend that's why I have to deal with what I got. Here's a better example to illustrate the matter: |
Would you accept a pull-request adding a new boolean parameter like I suggested? |
If it makes sense I would - but I haven't had a chance to think through this yet, and your use case. I'm pretty sure you can get around this problem by juggling the startPage and the perPageParam, because |
When starting with |
ahhh gotcha. once #43 is merged ur golden! |
In order to implement this, you would have to depend on the private member |
Since #43 is merged this can be closed. Great work guys! |
@dj-hedgehog Can you post the code and/or an example Route of how you solved this? I'm in the same boat w/ Sails. Thanks |
@kellyselden I tried this but it can't access
@DanLeininger Yes I will once it works |
I was (and still am) having the same issue, couldn't access this.get("_currentPage") |
@dj-hedgehog you can get around this by creating a policy in Sails to translate the query before it hits waterline: add
Then in
I'm changing the
|
@DanLeininger |
@dj-hedgehog yep, agree, it'd still be nice to have that |
Try watching skip_page: function () {
return this.get("_currentPage") * 2;
}.property('_currentPage'), It may not be recalculating. |
This works quite nice for me, thank you 👍 |
You may want to open an issue/PR to make |
👍 for making it public |
You didn't say whether you want some level of abstraction or just turn _currentPage into a public property . I did the latter one and opened PR #58 |
My backend, Sails delivers paginated data like in this form
/api/posts?skip=5&limit=5
.skip
means that 5 entries are skipped (not five pages).Is there any way to get that behaviour running with ember-infinity? If not I could extend it to have a switch
bool: skipInsteadOfPage (false)
to include this behaviour.In my backend the first page with 5 entries would be:
/api/posts?skip=0&limit=5
The second page is:
/api/posts?skip=5&limit=5
The text was updated successfully, but these errors were encountered: