Open vanness145 opened 6 years ago
Perhaps something like this will fix your problem.
lastPage: null,
lastParamsForBackendCounter: null,
pageChanged: Ember.observer("page", "perPage", function() {
var page = this.get('page');
var lastPage = this.get('lastPage');
var paramsForBackendCounter = this.get('paramsForBackendCounter');
var lastParamsForBackendCounter = this.get('lastParamsForBackendCounter');
if (lastPage != page || lastParamsForBackendCounter != paramsForBackendCounter) {
this.set('lastPage', page);
this.set('lastParamsForBackendCounter', paramsForBackendCounter);
this.set("promise", this.fetchContent());
}
}),
I don't know what impact this would have. @alejandrodevs can you take a look while thinking about the remote redesign.
solved ? i faced the same problem on ember octane
@ppkpp I never implemented this code because I don't oversee what impact it would have on others. Do you think it would break something?
setOtherParam will force the ember-cli-pagination to re-fetch current page.. However in my case, it would not work if I were to re-fetch the current page for the second time..
I looked into page-remote-array.js and found out that it doesnt run this.fetchContent() when setOtherParam was fired second time onwards because the lastPage was set to page..
Any idea hw to get this work? I need setOtherParam to re-fetchContent every time it was called..