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

Second Radwindow Showing Behind First

2 Answers 80 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bryan
Top achievements
Rank 1
Bryan asked on 20 Nov 2008, 04:23 PM
I am opening a radwindow from within a radwindow using the technique discussed here: http://www.telerik.com/help/aspnet-ajax/window_programmingopeningfromwithin.html.
It works perfectly when calling from an asp or classic form button, but when I call the exact same function from a dropdownlist or radmenu the second window opens behind the first .  Maybe there is another event firing on the calling window that is causing it to stay active?  Any ideas?
function openWin(strURL) {
                var parentPage = GetRadWindow().BrowserWindow;
                var parentRadWindowManager = parentPage.GetRadWindowManager();
                var oWnd2 = parentRadWindowManager.open(strURL);
}
<button onclick="openWin('http://google.com');">test</button> ---this works correctly
<select onchange="openWin('http://google.com');"><option>1 </option><option>2 </option></select>  ---this opens the second window behind the first

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Nov 2008, 09:41 AM


JavaScript:

function openWin(strURL)  
{      
    var parentPage = GetRadWindow().BrowserWindow;  
    var parentRadWindowManager = parentPage.GetRadWindowManager();  
    var oWnd2 = parentRadWindowManager.open(strURL);  
    window.setTimeout(function()  
    {  
        oWnd2.setActive(true);  
    },0);  
}  
 


Thanks,
Princy.
0
Svetlina Anati
Telerik team
answered on 21 Nov 2008, 10:10 AM
Hi Bryan,

I suggest to open the second radWindow with a little timeout instead of setting it to be active as shown below:

function openWin(strURL) {  
                var parentPage = GetRadWindow().BrowserWindow;  
                var parentRadWindowManager = parentPage.GetRadWindowManager();  
                var oWnd2;  
                setTimeout(function()  
                {  
                   oWnd2= parentRadWindowManager.open(strURL);  
                }, 0);  
}  
 



Kind regards,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Bryan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or