How to set the GlideDialogWindow in center of the screen ?

Linga Suvetha1
Tera Contributor

Hi ,

 

I have create one Dialog Window. But it is not fit in the center of the screen.

The Code I have written:

var gwd = new GlideDialogWindow('popup');
            gwd.setTitle('');
            gwd.setSize(400, 200);
            gwd.adjustBodySize();
            gwd.render();
LingaSuvetha1_0-1696847720637.png

Kindly pour your suggestions to set this dialog window on center of the screen.

1 ACCEPTED SOLUTION

Alex Tod1
Kilo Sage

Hello @Linga Suvetha1,

 Can you try to add this line of code: 

   

 

gwd.center(); // Center the dialog window on the screen

 

View solution in original post

4 REPLIES 4

Peter Bodelier
Giga Sage

Hi @Linga Suvetha1,

 

There is no method to center a GlideDialog window.

 

You could try GlideModal instead of GlideDialog window.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Alex Tod1
Kilo Sage

Hello @Linga Suvetha1,

 Can you try to add this line of code: 

   

 

gwd.center(); // Center the dialog window on the screen

 

Hi @Alex Tod1,

 

Where did you find that method?
Apart from GlideDialogWindow being deprecated anyhow, the center method is not listed.

 

PeterBodelier_0-1696848994454.png

 


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

It works, Thank you 🙂