JScript Question

2 posts, 0 answers
  1. James Greaves
    James Greaves avatar
    5 posts
    Member since:
    Oct 2009

    Posted 23 Nov 2009 Link to this post

    Hi,

    I am currently using the radwindow as a means of user input.  I have a Java function that will open a different dialog (seperate aspx page) depending on which tab a user is on. 

        function openWin() {  
                var returned = getSelectedTab();  
                  
                    if (returned == 0) {  
                        
                        var partreturned = getSelectedPartSubTab()  
                        if (partreturned == 0)  
                         {  
                         var oWnd = radopen("./Query/PartRevDialog.aspx", "RadWindow1");  
                         }  
                         else if (partreturned == 1)  
                         {  
                         var oWnd = radopen("./Query/PartCatDialog.aspx", "RadWindow1");                       
                         }  
                      }  
                    else if (returned == 1) {  
     
                    if (partreturned == 0) {  
                        var oWnd = radopen("./Query/DocTitleDialog.aspx", "RadWindow1");  
                    }  
                    else if (partreturned == 1) {  
                        var oWnd = radopen("./Query/DocRevDialog.aspx", "RadWindow1");  
                    }  
                      }  
                  } 


    This works perfectly and the correct query dialog is opened.  What i would like to do however is have a function that can onclientclose rebind a specific radgrid.

    I can hard code the radgrid (as below:)

     function RefreshGridPartRev() {  
                      var masterTable = $find("<%=RadGridPartRev.ClientID %>").get_masterTableView();  
                      masterTable.rebind();  
                  } 

    This fires on clientclose of the radwindow and will rebind the grid "RadGridPartRev".  I would like to change this grid depending on which ASPX window the user has been on.  Is there a way to do this or will have to resort to determining which tab the user is on?  


    Cheers,

    James

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 23 Nov 2009 Link to this post

    Hi James,

    If you close the window from a button within the content page, you can send an argument to the parent page which you can check in the OnClientClose event handler - just like shown in this help article.
    Another option is to use get_navigateUrl() in the OnClientClose event handler which will give you the page with which that RadWindow has been opened. Note that because of browser's security, you will be able to get only the page with which that RadWindow has been opened initially. This means that if your users open Dialog1.aspx and then are able to browse to another content page in that RadWindow, you will be able to get only Dialog1.aspx in get_navigateUrl().



    All the best,
    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.
Back to Top