I've got a Window as an Editor for a RadGrid and I'm converting it from the regular controls to the Prometheus versions. Everything works ok except the grid doesn't refresh itself after the window closes. I've got the following code:
Main Page:
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function ShowEditForm(id, rowIndex) |
| { |
| var grid = $find("<%= ScheduleEditRadGrid.ClientID %>"); |
| var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element(); |
| grid.get_masterTableView().selectItem(rowControl, true); |
| window.radopen("assignments_edit.aspx?sid=" + id, "EditAssignmentsDialog"); |
| return false; |
| } |
| function refreshGrid(arg) |
| { |
| if(!arg) |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); |
| } |
| else |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); |
| } |
| } |
| </script> |
| </telerik:RadCodeBlock> |
and in the Window Page:
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function CloseAndRebind() |
| { |
| GetRadWindow().close(); |
| GetRadWindow().BrowserWindow.refreshGrid(null); |
| } |
| function GetRadWindow() |
| { |
| var oWindow = null; |
| if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog |
| else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well) |
| return oWindow; |
| } |
| function CancelEdit() |
| { |
| GetRadWindow().close(); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
Can you tell me what I haven't changed yet?
Also on a side note your example for this - http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx doesn't post the window page code for some reason. It also references the KB for the regular controls in the Description for Edit/Update and on that same line tells you to set EnableAJAX to True on the grid, except we know that property was removed. The part of the Description for Insert gets it correct. You guys might want to update that so folks trying it for the first time don't get confused.
Thanks,
Jimmy