add a Loading window to widget while the server is updating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 04:23 AM - edited 10-19-2022 04:23 AM
Hello everyone!
I have in the widget there is a confirmation of the action through the swal in the client controller
swal({
~~~~
}).then(result => {
if (result.value) {
c.server.update();
}
I want it to show a loading window while the server is processing information and updating, and when it finishes, it closes. How can I implement this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 04:31 AM
Maybe something like this..
In the HTML you could have something like:
<div align="center" ng-show="!dataLoaded && loading">
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
<span class="sr-only">${Loading}...</span>
</div>
<div ng-show="dataLoaded" >
<p>content</p>
</div>
And in the client you could add two variables:
//Client
$scope.dataLoaded = false;
$scope.loading = false;
// And then set loading to true when you are loading, so inside your swal maybe??
$scope.loading = true;
//And in your if(result.value) - have something like this..
$scope.loading = false;
$scope.dataLoaded = true;
}
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 05:34 AM
I need it to be an overlay, or a popup window that closes itself