Reputation: 1022
I'm using this perfectly working pagination solution.
It has a feature: it asks the server the whole set of data. I would like only a portion of it to be requested.
What do i need to do in ember-data to configure my requests so that they include some more parameters with the page info?
thank you
UPDATE: done in this way:
App.Books = Ember.Route.extend
setupController: (controller, model) ->
controller.set 'content', App.Book.find({page_number: controller.get('currentPage')})
Upvotes: 3
Views: 1176
Reputation: 1158
You can send query to find
method of the DS.Model
. So if you have endpoint that follows OData protocol you would do this:
App.Post.find({ '$top': 10, '$skip': 0 });
and it would return you only first 10 posts.
Upvotes: 3