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

Calling a javaScript function in a child window

3 Answers 182 Views
Window
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 10 Jun 2011, 03:23 PM
Hi guy,

I have a good question for you. I have a main window (win0) that call a window (wind1) that call another window (win2). In the win2, I have a grid and I call another window (win0_1), but this window was declared in the radWindowManager of the win0. My problem is that when I close my win0_1, I want to make a Rebind on the grid on the win2, but I don't know how to do this. In fact, I'm using dataSet for the grid and when I closed the win0_1, data are add to the dataSet of the grid, so I just have to refresh my grid and the data will appears. I think about calling a javaScript function that is in the win2, but how to access to the radWindow of a child of a child of a window ?. 
Thank you,

David Lefaivre-Boucher

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 13 Jun 2011, 11:29 AM
Hi David,

I believe that this documentation article will be of help. You can also check our Returning Values from  a Dialog demo that uses the same logic shown in the help article.

Regards,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
David
Top achievements
Rank 1
answered on 13 Jun 2011, 03:41 PM
Thank you, but it doesn't resolve my problem at 100%.  To explain mey problem, I think that the best is that I show you the "hierarchy" of my window  :

- Main window
    - Window A
    - Window B
        -Window C

What I want is to access a JS function in Window C from WIndow A. Here is my code in window A:

var win = GetRadWindow().get_windowManager().getWindowByName("WindowB");
win.get_contentFrame().contentWindow.JsFn();

So, in Window A, I'm calling a JS function in Window B.

Here my code in Window C :

function CallAddRoleJsFn() {
     var win = GetRadWindow().get_windowManager().getWindowByName("WindowC");
       win.get_contentFrame().contentWindow.AnotherJsFn();

The problem is that Window C didn't seem to be find. So, I guess GetRadWindow.get_windowManager() calls the manager of the parent window. So, I try to call the RadWindowManager in the Window B, but I didn't found how. May someone helps me please ? 
0
David
Top achievements
Rank 1
answered on 13 Jun 2011, 04:37 PM
Find it,

Just have to use GetRadWindowManager instead of GetRadWindow.get_windowManager()
Tags
Window
Asked by
David
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
David
Top achievements
Rank 1
Share this question
or