To resize the dialogue box to come down under breadcrumbs

Mishu
Tera Expert

I have a deletegate form which gets open when we click on New button shown in Snap 1 , I want this dialogue box to come under the breadcrumb Home > Delegate. Please advice how to make this change:

 

Mishu_1-1736434621044.png.

Mishu_0-1736434602839.png

 

5 REPLIES 5

Robbie
Kilo Patron
Kilo Patron

Hi @Mishu,

 

Is there a particular reason why centering the Modal doesn't work? Are you trying to provide visibility to fields on screen for example? There's a reason why it's centered from a UX perspective to cater for different screen/browser sizes etc.

 

Sadly the Developer API notes don't cover any parameters for this, however, if the GlideModal is displayed on a portal as shown in your screen shot, CSS is always an option as show by an example below:

 

 

/* Adjusting position of the GlideModal */
.glide_modal {
    position: absolute !important;
    top: 50px !important;   /* Set your desired top position */
    left: 100px !important;  /* Set your desired left position */
    right: auto !important;
    bottom: auto !important;
}

 

 

GlideDialog API: (https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/...

 

An alternative option I've seen online but please note this is not tested by me is to try the below via javascript. However, again I'd prefer to understand why centering doesn't work initially as various screen sizes are often a forgotten perspective.

 

 

var modal = new GlideModal('modal_dialog');
modal.setTitle('Custom Modal Title');
modal.render();

// Wait for the modal to be rendered, then adjust its position
modal.on('render', function() {
    var modalElement = document.querySelector('.glide_modal');
    if (modalElement) {
        modalElement.style.position = 'absolute';
        modalElement.style.top = '100px';   // Change top position
        modalElement.style.left = '50px';   // Change left position
    }
});

 

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.




Thanks, Robbie

Ankur Bawiskar
Tera Patron
Tera Patron

@Mishu 

how are you rendering it?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Through another widget where New button is placed :

 

Mishu_0-1736437016989.png

 

 

@Mishu 

check this link and enhance your code to align to left

How to center a popup modal in servicenow portal? 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader