Show loading spinner while model is loading
See original GitHub issueHi, before using your pagination, i use to have a loading var on my controllers set to false, whenever i changed the model i would set this loading to true and to false again on the promise return, success/fail method(i mean “save().then(success, fail)”), so i can show a loading spinner on the view(just in the table area) while model is loading.
Question is, how can i implement this with this pagination? i thought something like this:
var loading = false,
fetchContent: function() {
this.set('loading', true);
res.then(function(rows) {
this.set('loading', false);
}
}
then in my template:
{{#if loading}}
<!-- Show loading -->
{{else}}
<!-- List entries -->
{{/if}}
I intend to use a reopen(paged-remote-array) on a mixing to add this implementation. Thank you.
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to Display Spinner on the Screen till the data from the API ...
The task is to display a spinner on the page until the response from the API comes. Here we will be making a...
Read more >How to show Page Loading div until the page has finished ...
Show activity on this post. This script will add a div that covers the entire window as the page loads. It will show...
Read more >How to manually show and hide loading or spinning image?
Instead of default datasource config/method to load remote data, I am using a custom function to load data and I like to manually...
Read more >How to display loading indicator while Blazor component is ...
To fix this, we will add a loading indicator. The loading indicator will be displayed till the Employees property is Null and the...
Read more >Spinners - Bootstrap
Bootstrap “spinners” can be used to show the loading state in your projects. ... While it doesn't technically spin, it does repeatedly grow!...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @mharris717, i did like this(have a look at the manipulation of loading property):
loading
propertyloading
totrue
at the beginningloading
tofalse
at success and failthen in my templates, i have:
{{partial "loading"}}
is a partial with a spinning loaderIt works very well like this, if you want to implement something like this would be a nice idea. You could just give access to the
loading
property so the user can manipulate they template like this if they want to.Added. https://github.com/mharris717/ember-cli-pagination/pull/137
Sorry I took so long here. Life really got in the way for a while. Thanks for taking the time to contribute!