Ember cli pagination not changing the display content


#1

I am using ember cli pagination for local store in my ember app. i have successfully created pagination area with proper page number but the display content is not changing with the page number. here is my code—

in my hbs– {{#each pagedContent as |rule index|}}

{{rule.Name}} {{/each}}
{{page-numbers content=pagedContent}}

in controllers—>

queryParams: [“page”, “perPage”], page: 1, perPage: 3, pagedContent: pagedArray(‘content’, { page: Ember.computed.alias(“parent.page”), perPage: Ember.computed.alias(“parent.perPage”), }), totalPages: Ember.computed.oneWay(“pagedContent.totalPages”),

how to change the display data?


#2

It looks good to me. Does it only show the first page?


#3

yes , for every page number it will show the first page.


#4

I will try to find time to create an Ember App that works with your controller because I don’t see anything wrong with it.


#5

Clone this:


#6

Also just created a Twiddle

https://ember-twiddle.com/c7952bcae2e7d9c413a02932b08b007f?openFiles=controllers.application.js%2C


#7

i have done exactly the same thing but not working for me.


#8

Yes I think there is something else wrong. Do you get console errors? Can you make a not working example on github or ember-twiddle?


#9

What does your route look like?


#10

my router is like —

> export default Ember.Route.extend({
>   model:function(){
>     return this.store.findAll('rule'); 
>   },
> });

#11

no i dont get console errors.


#12

Looks like you need to add the queryParams config to the route

  queryParams: {
    page: { refreshModel: true },
  }

#13

It should not be necessary. See the twiddle. But it could solve the problem for now. Thanks!


#14

it did not solved my problem


#15

Perhaps share the failing code. If you don’t have an extra filter on your controller I can’t explain this bug.