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

[Solved] invoke Javascript

2 Answers 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
Catarino
Top achievements
Rank 1
Catarino asked on 21 Dec 2007, 03:08 PM
Hi,

How  do I invoke a javascript function in the parent page?

here is my code:

function

RefreshParent()

{

var oWindowMan= parent.parent.GetRadWindowManager();

var oWndResManager = oWindowMan.getActiveWindow();

if(oWndResManager != null)

{

//Call refresh function

var iframeToRefresh = oWndResManager.get_ContentFrame();

iframeToRefresh.contentWindow.InvokeAJAXRadTreeReload();

}

}

in the line "iframeToRefresh.contentWindow.InvokeAJAXRadTreeReload();"i get the error that Object doesn't support this property or method. but the function exists in the parent page.
Is anything wrong with the code, or is there any other way of doing that?

Regards,

Catarino

2 Answers, 1 is accepted

Sort by
0
Catarino
Top achievements
Rank 1
answered on 21 Dec 2007, 06:04 PM
Ok, I think the problem is because the name of the windows and the ID´s change when we´ve made the updated to the new radwindow. So how can I solve this?
0
Georgi Tunev
Telerik team
answered on 27 Dec 2007, 07:10 AM
Hi Catarino,

I am not quite sure what exactly you want to achieve, because from your code you seem to call a function that resides in  the content page of the RadWindow, not in the parent. For convenience I've attached to this thread a small sample that shows how to call a predefined function on the parent page - please use it as a base and extend it further to fit your requirements.




All the best,
Georgi Tunev
the Telerik team

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