confirm on close of maximized modal window

3 posts, 0 answers
  1. Albert Shenker
    Albert Shenker avatar
    579 posts
    Member since:
    Mar 2004

    Posted 09 Nov 2011 Link to this post

    I open a modal rad window using the code below and specify a callback function to display a confirmation message to make sure the user wants to close the window. Everything works fine if the window is opened to a specific size. However, if I open the window and then maximize it, when the user attempts to close the window, it seems that the the confirm message gets displayed "behind" the rad window. Since it is maximized, the user cannot see it. The window doesn't close and there is no indication to the user. I'm not sure why the massage appears "on top" of the rad window if it is opened to a particular size, but behind if it is maximzed, however is there a way to make sure the confirmaiton message is always on top of the active rad window, even if it is maximized?

    function openWindow(someUrl, width, heigth, xPos, yPos) {
          
        var oWin =  window.radopen(someUrl, 'MyWindow');
        oWin.setActive(true);
         
        

          oWin.setSize(width, height);

        if (xPos != null && yPos != null) {
           oWin.moveTo(xPos, yPos);
       }
       else {
           oWin.center();
       
        oWin.maximize();
         oWin.add_beforeClose(onBeforeClose);
                             
    }
             
    function onBeforeClose(sender, arg) {
            function callbackFunction(arg) {
                   if (arg) {
                       sender.remove_beforeClose(onBeforeClose);
                       sender.close();
                    }
               }
               arg.set_cancel(true);
               radconfirm("Are you sure you want to close this window?", callbackFunction, 400, 150, null, "Close Window");
           }
     
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Nov 2011 Link to this post

    Hello Albert,

    I cannot reproduce the issue at my end. Try setting the z-index dynamically as explained in this forum.
    Set z-index of radalert being launched from a RadWindow

    -Shinu.
  3. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4609 posts

    Posted 10 Nov 2011 Link to this post

    Hello Albert,

    You can also set the ShowOnTopWhenMaximized property of the RadWindowManager to false (it defaults to true) as it otherwise causes a maximized RadWindow to have a very large z-index (100000) which is not counted when the RadConfirm is shown, as z-index calculations must be based on the actual z-indexes of other normal windows.


    Greetings,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top