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

[Solved] Obtaining the radWindow client object

1 Answer 85 Views
Window
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 19 Jun 2008, 08:35 AM
How do you obtain the radwindow object from a page using a radWindow

e.g My MainWindow.aspx has a RadWindowManager and creates Window1.aspx. However, I would like a close button in Window1.aspx. I must use the close method on the radWindow object. However, I am not sure how to obtain the radWindow object within Window1.aspx.

MainWindow.aspx
var oWnd = window.radopen("window1.aspx", "subdialog");  
 
 

Window1.aspx

function closeWindow()  
{  
    var oWnd = ????????  
    oWnd.close();  
}  
 

Thanks,
Martin

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 19 Jun 2008, 08:47 AM
Hi Martin,

You can do this by using the GetRadWindow() function - it is used in almost every demo and is available in the documentation as well:

function GetRadWindow()  
{  
  var oWindow = null;  
  if (window.radWindow)  
     oWindow = window.radWindow;  
  else if (window.frameElement.radWindow)  
     oWindow = window.frameElement.radWindow;  
  return oWindow;  
}   

Once you get a reference to the window, you can call its close() method:

function closeWin()
{
    var oWnd = GetRadWindow();
    oWnd.close();
}


All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Martin
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or