This is a migrated thread and some comments may be shown as answers.

confirm on close of maximized modal window

2 Answers 133 Views
Window
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 09 Nov 2011, 06:49 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Nov 2011, 08:05 AM
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.
0
Marin Bratanov
Telerik team
answered on 10 Nov 2011, 01:07 PM
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
Tags
Window
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Shinu
Top achievements
Rank 2
Marin Bratanov
Telerik team
Share this question
or