How to close a glide overlay window with onclick function.

cwmurphy
Mega Expert

I've created a button for end users to select a shipping method for purchase requests.   A glide overlay window pops up and gives them their choices.   Once they make a selection, there is a button called "Ship It" that they click.   I would like this button to close the glide overlay window.   So far, every attempt has been unsuccessful.   Does anyone know what I would put in my UI Page function to get this window to close one they click the "Ship It" button?  

18 REPLIES 18

yes, you are right, that mike() is calling felina() using mike(felina()), I tried the same to do, its working on UI Page. but when i tried again with some complex jelly, it was not working. May be jelly is broking something. After that, I changed the call to mike() and inside mike() function, I specifically asked for felina() than it was working fine.



Try to do the same, may be it will work.


Let me know, If above method calling resolve the issue.



And, you can also achieve the same by using GlideDialogWindow() as GlideOverlay() is still in development.



Thanks


Akash Rajput


cwmurphy
Mega Expert

I put in a ticket at https://hi.service-now.com/ on this issue.   Here is the response I received:



The reason why the method GlideDialogWindow.get().destroy() is not working is because it's a bug.   There has been a PRB created for it which is PRB596887 but dev is still working on it and there is no workaround for it at the moment.



There we have it.   It's supposed to work, but currently is not!   Once I get any additional info, I will come back and update this thread to let everyone know when it's working again.


lol, I was right in the first place but issue with SN got me thinking in all possible directions


-Anurag

elliott6
ServiceNow Employee
ServiceNow Employee

Hey Chris, try this.



var huell;


function shippingOptions() {        


      huell = new GlideOverlay({                                            


      title: 'Shipping Options',                                            


      form: 'shipping_options',                                                    


      height: 370,                                                    


      width: 340


});                                                                                    


      huell.render();          


      return false;


}


function felina(){          


      huell.close();


}



GlideOverlay has a close method on it that is separate from GlideWindow, meaning GlideDialogWindow.getWindow.destroy wont work. This should close your overlay.