dhtmlxWindows::centerOnScreen

I construct my main window using the 4L layout
I attach cell “b” to a URL

That URL may open a modal window
I would like to center that window inside the main window (browser window) - as the alert window does.

Calling centerOnScreen centers the window inside cell “b”.
Any advice?

Because of architecture considerations, I prepare that the attached URL will not “know” about that layout - but I can live with any solution.
Best Regards, alon.

If you need to center window relative to the hole screen you need the next:

dhxWins.window(id).center();

If you need center this window relative to the cell B you need the approach below:

dhxLayout = new dhtmlXLayoutObject(document.body,"4L"); dhxWins = new dhtmlXWindows(); dhxWins.enableAutoViewport(false); dhxWins.attachViewportTo(dhxLayout.cells("a")); w1 = dhxWins.createWindow("w1", 20, 30, 320, 240); w1.center();

Thanks for your reply.
I was not clear enough…

in main_page.html

dhxLayout = new dhtmlXLayoutObject(document.body,"4L");
dhxLayout.cells("a").attachURL('page2.html')

in page2.html

dhxWins = new dhtmlXWindows();
w1 = dhxWins.createWindow("w1", 20, 30, 320, 240);
w1.center();

my window is centered inside cell “a” (I think because its the parent) - I would like to have my window center at the whole screen.

Please, make and attach completed demo
docs.dhtmlx.com/doku.php?id=othe … leted_demo
We’ll try to help you in your case.