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

onRadWindowClose problem

3 Answers 66 Views
Window
This is a migrated thread and some comments may be shown as answers.
Cliff Gibson
Top achievements
Rank 1
Cliff Gibson asked on 10 Aug 2010, 02:11 PM
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;
        }

 

3 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 10 Aug 2010, 02:19 PM
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.
0
Cliff Gibson
Top achievements
Rank 1
answered on 10 Aug 2010, 02:21 PM
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
0
Cliff Gibson
Top achievements
Rank 1
answered on 10 Aug 2010, 03:21 PM
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...!
Tags
Window
Asked by
Cliff Gibson
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Cliff Gibson
Top achievements
Rank 1
Share this question
or