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

[Solved] Automatically close RadWindow after 2 seconds

2 Answers 346 Views
Window
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 2
Joseph asked on 14 Jan 2010, 04:37 PM
I would like to be able to auto close a Rad Window after 2 seconds. (Everything works except for the auto close after 2000ms). I have tried the setTimeout like this:

 

function openQuickActionRadWindow(tabid,XModID)

 

{

 

var oWnd = radopen("/Default.aspx?tabid=" + tabid + "&xmfid=5&SkinSrc=[G]Skins/Blue-NCPP/Plain&xmid=" + XModID, "RadWindow3" );

 

oWnd.Center();

oWnd.add_close(RefreshGrid);

setTimeout(oWnd.Close, 2000);

}

but I get a javascript error: Object doesn't support this property or method. 

The details:
Browser: IE 8
Version: 2009.3.1208.35

Thanks,
Joe

2 Answers, 1 is accepted

Sort by
0
Joseph
Top achievements
Rank 2
answered on 14 Jan 2010, 04:58 PM
Ok - figured it out:

changed setTimeout to:

setTimeout(autoCloseWindow, 2000);

then added:

 

 

function autoCloseWindow()

 

{

 

var manager = GetRadWindowManager();

 

 

var window1 = manager.getWindowByName("RadWindow3");

 

window1.close();

}

0
Georgi Tunev
Telerik team
answered on 15 Jan 2010, 05:43 AM
Hello Joseph,

The JavaScript error that you get, occurs because you should use the correct syntax of the close method - oWnd.close().
As an alternative to the solution that you found, you could use the following approach:

function openQuickActionRadWindow(tabid,XModID)
{
    var oWnd = radopen("/Default.aspx?tabid=" + tabid + "&xmfid=5&SkinSrc=[G]Skins/Blue-NCPP/Plain&xmid=" + XModID, "RadWindow3" );
    oWnd.Center();
    oWnd.add_close(RefreshGrid);
 
    window.setTimeout(function()
    {
        oWnd.close();
    }, 2000);
}


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Joseph
Top achievements
Rank 2
Answers by
Joseph
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or