- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 11:25 AM
Hi All,
I'm calling a script include that can take about a minute to run (it's a doozy, but necessary), which is being fired from an onchange script in a catalog item. It's a very simple form and so it's quite possible that a user will complete it before the script is complete. I'd like to add an alert that fires either on the onchange or perhaps onsubmit and stays up until the include has returned a value. I'm sure it's possible, we've got something similar that happens within our cart, but I haven't had any luck figuring it out. Your help is much appreciated.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:31 PM
Thanks, guys. I ended up stumbling onto the Custom Dialog article and it works great. Much like the OOB showLoadingDialog():
var gdw = new GlideDialogWindow('show_list'); |
gdw.setTitle('Gimme a second. Sheesh.');
gdw.setSize(100,300);
gdw.render();
::insert code::
gdw.destroy();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:12 PM
Edit: The solution below is best especially if you do not need any customization
I think you would need to add a custom element to the screen. something like this may work for you
call this when you make the ajax call
var iframeDiv = document.createElement('div');
iframeDiv.id = "popupFrameDiv";
document.body.appendChild(iframeDiv);
document.getElementById('popupFrameDiv').innerHTML = '<div id="popupFrameDivBG" style="background-color: rgba(0, 0, 0, 0.8);position: fixed;width: 100%;height: 100%;top: 0;text-align:center;padding-top:20px;"><div style="border-radius:10px;padding:10px;width:500px;background:#fff;height:300px;margin: 0 auto;font-size:20px">Please wait while the data is loaded.</div></div>';
and this after you have gotten the data
document.getElementById('popupFrameDiv').parentNode.removeChild(elem)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:23 PM
Hi David,
Try this simple thing on client scripts
Where you have to start the popup, just write this
showLoadingDialog();
when you have to close it, write this.
hideLoadingDialog();
Somple OOB solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:31 PM
Thanks, guys. I ended up stumbling onto the Custom Dialog article and it works great. Much like the OOB showLoadingDialog():
var gdw = new GlideDialogWindow('show_list'); |
gdw.setTitle('Gimme a second. Sheesh.');
gdw.setSize(100,300);
gdw.render();
::insert code::
gdw.destroy();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2015 12:33 PM
i like the title