- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2023 10:28 PM
Hello, anyone with any idea on this, please revert ASAP
I have ui action on table, and if i click it , it displays one pop up with comment box and Cancel, Ok buttons.
Now, if user fills comments and click 'ok', it takes some time to update record.
For that time, i want to show loader in existing pop up.
i tried enhancing my ui page (client script of ui page at line 13), but i was only able to place one loading pop up over my existing pop up
Anyone, who has idea on this please share some code or links, Thanks!!
Note- by loader i mean exactly like this----
Ui action (client side)--
UI page----
HTML---
Client script--
processing script--
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 01:19 AM - edited 03-20-2023 01:20 AM
@akshayp ,
If you want to use the same modal just to render the separate content here is the example, I believe in your use case you just want to show the loader to the user for a good UI point of view, please check below case:
var mod = new GlideModal().get('sn_vdr_something........'); // Please provide the name of first GlideModal parameter
mod.renderWithContent('<div><img src="https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExZmRkZDExYWRhODFjYWVjOGNjYzhmMDgwODRlNDBjN2Q0MGQ4ZTcyMyZjdD1n/3oEjI6SIIHBdRxXI40/giphy.gif"></img></div>')
By this manner, you can use the same GlideModal for your different content.
if you want to destroy the previous modal, you can use:
var mod = new GlideModal().get('sn_vdr_something........');
mod.destroy();
After destroying it, attach a new one by creating a new GlideModal object, but if your use case is specific to the loader, you can use the first suggestion and provide any image in it to display on the modal. You can also change the title in the same way.
Please add some css in the div to align image center.
Tried in my dev instance it worked for me:
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 01:03 AM
you can use this to destroy the UI page
GlideDialogWindow.get().destroy();
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 01:08 AM
so below code is some kind of OOB code, which will render pop up same as 1st screenshot.
Now can you please tell me from above script, where i need to make change so that on click of ok 1st pop will closed and 2nd pop up will open
Loading pop up---
loadingDialog = new GlideDialogWindow("dialog_loading", true);
loadingDialog.setPreference('table', 'loading');
loadingDialog.setTitle('Loading...'); //Set the loading dialog title here...
loadingDialog.render();
So that i can close this string, thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 01:57 AM
you can close/destroy just before calling the 2nd one
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 01:19 AM - edited 03-20-2023 01:20 AM
@akshayp ,
If you want to use the same modal just to render the separate content here is the example, I believe in your use case you just want to show the loader to the user for a good UI point of view, please check below case:
var mod = new GlideModal().get('sn_vdr_something........'); // Please provide the name of first GlideModal parameter
mod.renderWithContent('<div><img src="https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExZmRkZDExYWRhODFjYWVjOGNjYzhmMDgwODRlNDBjN2Q0MGQ4ZTcyMyZjdD1n/3oEjI6SIIHBdRxXI40/giphy.gif"></img></div>')
By this manner, you can use the same GlideModal for your different content.
if you want to destroy the previous modal, you can use:
var mod = new GlideModal().get('sn_vdr_something........');
mod.destroy();
After destroying it, attach a new one by creating a new GlideModal object, but if your use case is specific to the loader, you can use the first suggestion and provide any image in it to display on the modal. You can also change the title in the same way.
Please add some css in the div to align image center.
Tried in my dev instance it worked for me:
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 02:05 AM
@Prince Arora exactly, i want to show loader to users for good UI point of view,
I will try this and let you know, thanks!!