Bug? New window from existing window: new opens under old


#1

Hello,

When I have a button in a window that opens another window, the new window opens UNDER the OLD window, which doesn’t seem natural.

Demonstration DHTMLx snippet code: o1hso3o0

(Sorry I didn’t give the complete link for the snippet code, I keep getting an error message from the forum saying: “Sorry, you cannot post a link to that host” !!!)

Is this a bug, or should I be doing something to make it appear on top? I looked at the API documentation but cannot find anything about how to set the windows Z layer position or perhaps a simple ‘bringToTop()’ method or similar…

Would appreciate any advice.


#2

I ran into the same kind of issues. The windows all seem to draw in at the same z-index, which makes it hard dealing with them if there are multiple windows open. I finally got to where I was including code in my “top” window to hide the “bottom” window during the AfterShow event of the top window, and then show the bottom window again with the AfterHide event of the top window. That, of course, requires that program flow only goes from the bottom window to the top window and then right back to the bottom window without anything else using that top window.

I do think the DHX5 methods for handling windows were decently robust, and I’ve been waiting to see if similar functions get brought into DHX7; functions for showing windows on top of others would be especially nice, even if it was a bringToTop() that could be called on the window you want to be on top of all the other windows. But I think this would probably require a window manager object, which is how it was done in DHX5 while DHX7 just treats all windows as individual objects.


#3

Calling show() method for the opened window will bring it to top
Something like:
https://snippet.dhtmlx.com/ym1x89ds


#4

Thankyou! This finally lead me to replace the line

        chartWindow.show();

with:

        dhx.awaitRedraw().then(function () {chartWindow.show();});

which works fine!

Although, it has to be said that this is very inelegant, in that:

  • It requires more code than it should
  • You’d NEVER guess to do this unless you find this page on Google …

But thanks none-the-less!