ClientClose adding in window, define in parent

2 posts, 1 answers
  1. Jan
    Jan avatar
    37 posts
    Member since:
    May 2008

    Posted 28 Apr 2010 Link to this post

    Hi,

    I would like to ask which way I can do this approach:

    I set the radWindowInstance.add_close(closeFunction) (javascript) IN radWindow, but my definition of closeFunction is on the parent page. 

    In Chrome i get closeFunction is not defined and didnt tested on other browsers. Javascript search for this function on page which is loaded onto radWindow. But I have it defined in parent. 

    for getting insatnce of RadWindow i use GetRadWindow() funcation.

    Is this approach even possible? Set up close function in window and define it in parent?

    I have no idea how deal this with other way. I Have radWindow deeply implemented and need this functionality for passing parameters. 

    Thanks for every reply. 
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Apr 2010 Link to this post

    Hi Jan,

    You can try calling a function defined in parent page, from the radwindow page as described in the following documentation.
    Calling Functions in Windows

    Then in the called function, attach the OnClientClose event for the radwindow.
    Here is the example code in radwindow page:
    javascript:
     
        function attachClose() { 
            GetRadWindow().BrowserWindow.CalledFn(); // call the Fn in parent 
        } 
    .
    Now in the parent page, write the code for attaching the event:
    javascript:
     
    <script type="text/javascript"
        function closeFunction() { 
            alert("closeFunction....."); 
        } 
     
        function CalledFn() { 
            var oManager = GetRadWindowManager(); 
            oManager.getWindowByName("Window1").add_close(closeFunction);   
        } 
    </script> 

    Regards,
    Princy.
Back to Top