3

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')})
Community
  • 1
  • 1
Alive Developer
  • 1,022
  • 1
  • 13
  • 25

1 Answers1

3

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.

Myslik
  • 1,178
  • 6
  • 14