Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Remove Close icon on the Dialog window

nishikanthk
Kilo Contributor

Hi all,

I have created to a UI page to display a dialog based on some conditions. can anyone tell me how to remove the Close icon on the dialog.

I tried dialog.removeCloseDecoration() ...but i'm getting an error that dialog.removeCloseDecoration is not a function.

Below is my code

var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new GlideModal("my_ui_page");
dialog.setTitle('Confirmation');
dialog.removeCloseDecoration(); // This is not working
dialog.setPreference("sys_id",g_form.getValue('sys_id'));
dialog.render();

 

Thanks in advance

1 ACCEPTED SOLUTION

j-mo
Tera Contributor

You need set a second parameter in your GlideModal declaration:

var gm = new GlideModal('ui_page_name',true);  <-- adding true removes the close icon

 

Here is the documentation

GlideModalV3

 

View solution in original post

6 REPLIES 6

nishikanthk
Kilo Contributor

Thank you very much. I was looking for it for a day. This helped me a lot

david631
Giga Expert

I've found the same effect is achieved by setting "readOnly" = "true" in GlideModal(String id, Boolean readOnly, Number width).