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

window close causing strange issue

3 Answers 36 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 24 Apr 2013, 01:42 PM
I have a window which is open on my main page.  I'm using a radsplitter.  I am using getActiveWindow and it returns the correct window.  When I call .close() I get the following $telerik is undefined.  I'm using the latest release.  Clicking the actual close button works with no error, but when I trigger close from my code is when the error shows.  The window does actually close though.

I'm using IE 10.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 24 Apr 2013, 02:03 PM
Hello Mike,

This is a bit strange and I can suggest you try the following:
- make sure DestroyOnClose is not set to true (in this RadWindow's or in the RadWindowManager's declaration)
- make sure the button/link that calls this closing script does not perform a postback. This can be related to first point - the page can start posting and in the same time the browser will start disposing it which can cause errors
- if the script is called from the server - use the Sys.Application.Load event to execute it as shown here, or add a small timeout around close().


All the best,
Marin Bratanov
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.
0
Mike
Top achievements
Rank 1
answered on 24 Apr 2013, 02:28 PM
Why do you say "make sure DestroyOnClose is not set to true (in this RadWindow's or in the RadWindowManager's declaration)" ?

setTimeout did the trick for me though.  Odd that I'm only running into this now.

thank you


0
Marin Bratanov
Telerik team
answered on 26 Apr 2013, 01:14 PM
Hi Mike,

DestroyOnClose disposes the iframe in the RadWIndow and if code tries to run in it while it is disposing this is likely to generate errors. A postback is a good example of this because MS AJAX has to dispose some object when the page is being unloaded for the postback, but if the iframe is being disposed by the browser this will cause a conflict - some code will attempt to use something else that is already disposed (in this case - one of our scripts).


Greetings,
Marin Bratanov
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
Mike
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Mike
Top achievements
Rank 1
Share this question
or