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

Close RadWindow from within itself

1 Answer 389 Views
Window
This is a migrated thread and some comments may be shown as answers.
Clint MacDonald
Top achievements
Rank 2
Clint MacDonald asked on 26 Sep 2007, 07:48 PM
How to Close a RadWindow from within itself.
the tradition javascript: window.close() does not seem to work.  I also tried redirecting to another html page that does the same thing but no go.

The examples show the source code for the parent page, but the the code on the radwindow page, so it is hard to follow though the path of the program execution.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 27 Sep 2007, 05:55 AM
Hello Clint,

To close a RadWindow from within itself, you need to:
  1. get a backreference to the parent rad window
  2. call its close() method.

e.g.:

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


As for the second part of your post, all dialogs are available in the C:\Program Files\telerik\RadControls 'Prometheus' for ASPNET Q2 2007\Live Demos\Window\Examples's subfolders. You can also see the source of the dialogs by right-clicking on them and choosing View Source from the context menu.


I hope this helps.



Greetings,
Georgi Tunev
the Telerik team

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