onRadWindowClose problem

4 posts, 0 answers
  1. Cliff Gibson
    Cliff Gibson avatar
    45 posts
    Member since:
    Oct 2009

    Posted 10 Aug 2010 Link to this post

    I've got a form with the two RadGrids, each one within a RadDock.

    If I open a window from a RadDock Command, and then handle the onClientClose event as per the script below the script runs OK and the RadGridFlightMeals rebinds and displays correctly.  However if I try to then Rebind RadGridFlightSeats by calling RadGridRebindFlightSeats() from within CloseRadWindowCreateFlightMeal() this says the object is null and cannot be found.

    I've tried calling seperately as per above and also including the find and rebind options within a single script but neither works.

    However if I call RadGridRebindFlightSeats() from server side using...

     

     

     

     

    RadScriptManager.RegisterStartupScript(this, this.GetType(), "RadGridRebindFlightSeats", "RadGridRebindFlightSeats();", true);

    ...

    when not closing a radwindow but from another command button on the dock header the script works OK...???


    <telerik:RadWindow runat="server"  ID="RadWindowCreateFlight" InitialBehaviors="None" 
                    NavigateUrl="~/Dialogs/CreateFlight.aspx" ReloadOnShow="true" Animation="None" OnClientClose="CloseRadWindowCreateFlight"
                    Height="550px" Modal="true" Title="Create Flight" Width="700px" Behaviors="Close, Move" Enabled="True" 
                    VisibleStatusbar="False" IconUrl="~/favicon.ico" KeepInScreenBounds="True" ShowContentDuringLoad="False">
                </telerik:RadWindow>


     

     

     

     

     

    function CloseRadWindowCreateFlightMeal() {
      
                var action = get_cookie("ACTION");
                delete_cookie("ACTION");
      
                if (action == "FLIGHT MEAL CREATED") {
                    var tabStrip = $find("ctl00_contentBody_tabStripEvent");
                    var tab = tabStrip.findTabByText('Flights');
                    tab.set_selected(true); //The same as tab.select();
      
                    var multiPage = $find("ctl00_contentBody_multiPageEvent");
                    var pageView = multiPage.findPageViewByID("ctl00_contentBody_pageFlights");
                    pageView.set_selected(true);
      
                    var masterTable = $find("ctl00_contentBody_RadDockFlightMeals_C_RadGridFlightMeals").get_masterTableView();
                    masterTable.rebind();
                }
      
                return false;
            }
                      
      
            function RadGridRebindFlightSeats() {
                var masterTable = $find("ctl00_contentBody_RadDockFlightSeats_C_RadGridFlightSeats").get_masterTableView();
                masterTable.rebind(); 
                return false;
            }

     

  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 10 Aug 2010 Link to this post

    Hello Cliff,

    Have you tried doing this, $find("<%=RadGridFlightSeats.ClientID%>"), instead of writing out the ClientID like you are doing now?

    Perhaps that is the issue, the id you wrote doesn't exist.

    I hope that helps.
  3. Cliff Gibson
    Cliff Gibson avatar
    45 posts
    Member since:
    Oct 2009

    Posted 10 Aug 2010 Link to this post

    Hi

    What you've put is actually the code I've written, the code I posted was the generated code at runtime...I've searched through the source and the object does exist.

    Cheers
    Cliff
  4. Cliff Gibson
    Cliff Gibson avatar
    45 posts
    Member since:
    Oct 2009

    Posted 10 Aug 2010 Link to this post

    Solved the problem by moving the call to RadGridRebindFlightSeats() to the Client OnMasterTableViewCreated event...

    ...not quite sure I understand why this works but now whenever GridFlightMeals is changed GridFlightSeats is rebound without any problems...!
Back to Top