When the user clicks the Export Button, I want an ajax loading panel to display over the Panel. Then, when the export is complete I'd like the loading panel to close.
Using the OnAjaxRequestStart I am able to fire the loading panel. For the export to work, I have to set the EnableAjax = false. The problem is that when that is set, the OnResponseEnd is never fired.
Here's what I have so far. Any help would be appreciated:
| //Script |
| <script type="text/javascript"> |
| var currentLoadingPanel = null; |
| var currentUpdatedControl = null; |
| function RequestStart(sender, args) { |
| currentLoadingPanel = $find("RadAjaxLoadingPanel1"); |
| switch (args.get_eventTarget()) { |
| case "btnExcel": |
| case "btnWord": |
| case "btnCSV": |
| //Disable Ajax |
| args.EnableAjax = false; |
| currentUpdatedControl = "Panel1"; |
| //show the loading panel over the updated control |
| currentLoadingPanel.show(currentUpdatedControl); |
| break; |
| } |
| } |
| function ResponseEnd() { |
| //hide the loading panel and clean up the global variables |
| if (currentLoadingPanel != null) |
| currentLoadingPanel.hide(currentUpdatedControl); |
| currentUpdatedControl = null; |
| currentLoadingPanel = null; |
| } |
| </script> |
| //RadAjaxManager Configuration |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="btnExcel"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="btnWord"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="btnCSV"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" /> |
| </telerik:RadAjaxManager> |