ember-cli-pagination icon indicating copy to clipboard operation
ember-cli-pagination copied to clipboard

Feature request for Infinite scrolling

Open ggrillone opened this issue 9 years ago • 0 comments

I've been working on implementing the infinite scrolling functionality of this addon, and it seriously rocks!

I came across a situation though that I feel might be a good improvement for this addon.

My scenario is that I am using infinite scrolling for a grid view in my application and this grid also has sorting capabilities. When I sort however, it ends up re-rendering everything and the page state of the pagedArray is lost so it is reset to 1. So what I ended up doing is maintaining a separate property to track the "current page". I thought if I passed in this value to the page parameter option that it could auto-load to that page, but that doesn't seem to be the case, i.e.:

var currentPage = this.get('currentPage'),
      perPageParam = this.get('perPageParam');

this.set('infiniteScrollObject', pagedArray('models', {
  infinite: 'unpaged',
  page: currentPage,
  perPage: perPageParam
}));

For now I just created a basic for loop to call the loadNextPage() function X number of times depending on the currentPage value, but it would be useful if setting page during initializing would load the other infinite scroll "pages".

ggrillone avatar Aug 25 '15 17:08 ggrillone