-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Displaying a loading spinner #88
Comments
What I did is just use |
Thanks I'll try that! |
I've found another solution to observe changes in the PagedRemoteArray. First, set a counter to the instance of PagedRemoteArray and set an observer for // routes/index.js
...
model(params) {
const queryParams = {};
Object.keys(params).forEach((key) => {
queryParams[key.decamelize()] = params[key];
});
return Ember.RSVP.hash({
approveVideos: this.findPaged('approve-video', queryParams),
approveVideoActions: this.findPaged('approve-video-action', { limit: 20 }),
});
},
setupController(controller, model) {
this._super(controller, model);
Ember.set(controller, 'approveVideos', model.approveVideos);
Ember.set(controller, 'approveVideoActions', model.approveVideoActions);
model.approveVideos.set('contentUpdated', 0);
model.approveVideos.addArrayObserver({
arrayWillChange() {},
arrayDidChange(array) {
array.incrementProperty('contentUpdated');
// or array.trigger('contentUpdated') and handle it somewhere by .on('contentUpdated') listener
},
});
},
... |
Hi there!
I was wondering if the add-on had a way to support showing some kind of a loading indicator when pagination is occurring. I am using a remote paginated API, and as such, there is a bit of a time lag between when the user clicks on a page number from when the data is returned. Is there a place where I can safely hook into the request and return of the data to show/hide a spinner? After digging into the library a bit, I see that the
fetchContent()
inpaged-remote-array.js
method is the place where the actual request is triggered, and a promise is resolved when the data comes back:Any thoughts on this? Another idea I had was to somehow use Ember loading substates to make this happen.
Thanks so much!
The text was updated successfully, but these errors were encountered: