-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pageable Collection #5
Comments
I don't know much about the internals of backbone.paginator. It does extend from the collection class to do it's work, which makes compatibility with Backbone.Sails an issue... It wouldn't take long to produce paginated class which extends from Backbone.Sails.Collection. I'll take a look at it tonight & pull what I come up with into the v0.2 branch. |
Just taking a look at the functionality of I am going to try to reproduce similar functionality for the v0.2 release. Hopefully it'll give this plugin a greater base of appeal. In the meantime, if your pagination needs are relatively simple, you can always write some quick functions on your class:
|
So far as counting is concerned, Sails can count the number of objects in a collection |
Ok thanks for that. The count is only required so the number of pages can be calculated, for just a next and prev page setup this isn't really necessary. |
For the total records could it be as simple as adding the following to the find blueprint?
|
Pretty much :) Feel free to add yourself. The blueprints are intended to be customizable after all. NB: I won't be working on |
I'm looking to change one of my existing apps to using Backbone.Sails but a lot of the collections use backbone.paginator and I'm assuming the 2 plugins wont work with each other.
Some of the functionality can be achieved by skip and limit in the query but I can't think of a sensible way of getting the total records so number of pages can be calculated as I don't believe there is a way to do a count without fetching the entire collection.
Any suggestions would be greatly appreciated.
The text was updated successfully, but these errors were encountered: