Advanced Search

Results 1 to 5 of 5

Thread: Z-index issue with multiple DHTML windows already open

  1. #1
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Z-index issue with multiple DHTML windows already open

    1) Script Title: Dhtml window widget

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/index.htm

    3) Describe problem: First off, love the script - very light and easy to implement!

    I'm using the script to load popup windows from an ajax loaded control panel area, via links in numerous datagrids. At times the user will click on a link which opens a popup window, and in that window has a link which pops up a second window (referenced from the parent window, so they are parallel).

    My first issue was that if a user opens 1 window, then opens the second, at times the second would show up under the first - this was fixed by calling the show() function any time a window is loaded. It does not work, however, when they are continuously called in succession.

    For example:
    If a user clicks on link #1, which opens window #1, then clicks on link #2, which opens link #2, the #2 window now shows on top of all, which is correct. If, however, #1 and #2 are open together, and the user clicks on another link in the parent window which would normally open window #1, the content in window #1 changes but it does not increment the window #1 z-index and remains hidden behind window#2. If you click on the drag bar, it focuses correctly, of course - but unless you close #2, or click on the drag bar of #1, #1 will remain behind #2.

    Is there an easy way of incrementing the z-index of a window any time it is called, regardless if it exists or not, to insure that they are always incremented to the top of the z-index list?

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 956 Times in 945 Posts
    Blog Entries
    15

    Default

    Hmm, you say:

    If a user clicks on link #1, which opens window #1, then clicks on link #2, which opens link #2, the #2 window now shows on top of all, which is correct. If, however, #1 and #2 are open together, and the user clicks on another link in the parent window which would normally open window #1, the content in window #1 changes but it does not increment the window #1 z-index and remains hidden behind window#2. If you click on the drag bar, it focuses correctly, of course - but unless you close #2, or click on the drag bar of #1, #1 will remain behind #2.
    The part in bold- are you calling open() or show() to open the same window again? Both functions when run does increment the z-index value of the DHTML window in question, so there shouldn't be an issue. FYI the method that sets the focus is the following:

    Code:
    dhtmlwindow.setfocus(t)
    Where "t" should be the variable referencing the DHTML window in question when you initialized it. If all else fails, you can try manually calling this method inside your triggering link.
    DD Admin

  3. #3
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yep - I am using dhtmlwindow.open() when calling the page, and thought it should increment correctly, but it does not. Additionally, if I open window 1, then open window 2, then focus on window 1 and attemp to open window 2 again (even though it is open and in the background, it should technically increment and bring it to the foreground) and it does not.

    Am I correct in assuming that is how it should function?

  4. #4
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 956 Times in 945 Posts
    Blog Entries
    15

    Default

    Hmm testing the issue using the 4 DHTML windows on the demo page, I can't replicate the problem. I've set Demo #3 and #4 to open automatically when the page loads (similar to #1 and #2 by default), then switched between clicking the "Open/Create DHTML window 3" and "Open/Create DHTML window 4" links. In each case, the focus is set to the correct window...
    DD Admin

  5. #5
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Curious!

    Without them open, I click on a link to open #1 and it is in focus. Leaving #1 open, I click on #2, and that is now in focus. If I click on #1 again, the window refreshes but does not focus. I can replicate in Chrome, IE and FF.

    Strange!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •