- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 02:41 AM
Hi,
Is there a way to show a modal loading dialog/popup, while an ajax call is in progress, in Agent workspace?
We used to use the following for UI16 view:
var loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setPreference('table', 'loading');
loadingDialog.setTitle('Loading...'); //Set the loading dialog title here...
loadingDialog.render();
Not sure how to achieve the same with workspace g_modal.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 03:50 PM
Sure.
Here is what I have for that widget:
HTML:
<div class="progress">
<div class="progress-bar" id="myBar" role="progressbar" style="width: {{c.value}}%" aria-valuenow="{{c.value}}" aria-valuemin="0" aria-valuemax="100">{{c.value}}%</div>
</div>
Client Controller:
api.controller=// Client Script
function ($timeout, $window, $interval) {
/* widget controller */
var c = this;
c.value = 0;
c.increaseProgress = $interval(function(){
if(c.value < 50)
++c.value;
else{
$interval.cancel(c.increaseProgress);
c.increaseProgress2 = $interval(function(){
if(c.value >= 50 && c.value < 90)
++c.value;
else{
$interval.cancel(c.increaseProgress2);
c.increaseProgress3 = $interval(function(){
if(c.value >= 90 && c.value < 100)
++c.value;
else
$interval.cancel(c.increaseProgress3);
}, 1000);
}
}, 200);
}
}, 50);
}
What this is doing is increasing the progress bar every 50 ms until it reaches 50%; after that increate until 90% every 200ms and then every second until 100%.
I don't have code in the Server script.
Please, if this answer is relevant for you, please mark it as correct and helpful.
Thanks,
Filipe

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2022 11:46 PM