-
Notifications
You must be signed in to change notification settings - Fork 49
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
How could I get the current page number when paginating? #161
Comments
By the way, I have another question. Besides having a variable with the value of the current page number when paginating, do you foresee another way to get a link to each individual page available in the full pagination set? I mean, something like the example showed at Displaying links to individual page numbers. Note: for the backend side provided by DRF 3.3.3 I'm using the PageNumberPagination class. Again, thanks a lot! |
Following Django Paginator, Unfortunately, the default django adapter doesn't support The easiest work-around would be to manually include Something like... export default DRFSerializer.extend({
extractMeta: function(store, type, payload) {
let meta = this._super(store, type, payload);
if (!Ember.isNone(meta)) {
if ( (meta.next-1) == meta.previous +1 )
meta['number'] = meta.next-1;
}
return meta;
}
}); Has this workaround been sufficient for folks? What's the feeling about including |
It makes sense to me that we include the current page number as a computed property. I'm a bit out of the loop on this project these days so I'll defer the final decision to @dustinfarris. If he agrees, then you're welcome to make a PR to add the feature. |
I like it! PR would be welcome! |
Hi, thanks for contributing this useful Ember adapter!
I'm playing with integrating a project of mine based on DRF 3.3.3 and Ember.js with Ember Data 2.6.0 and ember-django-adapter 1.1.2.
Right now in an HBS template file that lists the instances of some given model I have something like this:
However, I would like to know how to do something like this in the same HBS template file:
Thanks in advance for your time and attention.
The text was updated successfully, but these errors were encountered: