alice
June 26, 2017, 1:59pm
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?
It looks good to me. Does it only show the first page?
alice
June 26, 2017, 4:00pm
3
yes , for every page number it will show the first page.
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.
Also just created a Twiddle
alice
June 30, 2017, 12:07pm
7
i have done exactly the same thing but not working for me.
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?
What does your route look like?
alice
July 1, 2017, 10:04am
10
my router is like —
> export default Ember.Route.extend({
> model:function(){
> return this.store.findAll('rule');
> },
> });
alice
July 1, 2017, 10:15am
11
no i dont get console errors.
Looks like you need to add the queryParams config to the route
queryParams: {
page: { refreshModel: true },
}
It should not be necessary. See the twiddle. But it could solve the problem for now. Thanks!
alice
July 4, 2017, 6:47pm
14
it did not solved my problem
Perhaps share the failing code. If you don’t have an extra filter on your controller I can’t explain this bug.