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

[Solved] Page freezes after disabling AJAX on Export

1 Answer 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 02 Jul 2014, 02:12 PM
I have run into a problem with exporting from a RadGrid. Whenever I export from the RadGrid, I have to turn off the AJAX. I download the file fine, but the webpage becomes frozen and I have to refresh the page for it to do anything. I have read a few forum posts and applied what they did but to no effect.

Here is what I currently have:

<script type="text/javascript">
    function requestStart(sender, args) {
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                args.get_eventTarget().indexOf("chkShowInactive") >= 0) {
            setTimeout(removePanel, 10);
            args.set_enableAjax(false);
        }
    }
  
    function removePanel() {
        $telerik.findControl(document, "RadAjaxLoadingPanel1").hide()
    }
</script>


<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" runat="server" ClientEvents-OnRequestStart="requestStart">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="chkShowInactive">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="chkShowInactive"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="rgvSafetyCommittees">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="rgvSafetyCommittees"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" InitialDelayTime="0" MinDisplayTime="500" Transparency="25">
                <div style="background-color: #ffffff; width: 100%; height: 100%">
                    <h1>
                        <br />
                        <b>Loading..</b>
                    </h1>
                </div>
            </telerik:RadAjaxLoadingPanel>
   
I have also tried something like the following to no effect: 

<script type="text/javascript">
    function requestStart(sender, args) {
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0 ||
                args.get_eventTarget().indexOf("chkShowInactive") >= 0) {
            setTimeout(removePanel, 10);
            args.set_enableAjax(false);
        }
    }
 
    function removePanel() {
        args.set_enableAjax(true);
    }
</script>


What the first one would do is attempt to manually hide the loading panel. The second one was just guess work. I had to disable the AJAX for it to download the files. I figured if I could wait a few seconds to re-enable the ajax that it would somehow 'fix' it. So far to my knowledge, the setTimeout doesn't really do anything for me in this case. If I remove it the problems still exist though.

Has anyone run into this issue before? My grid is not inside an update panel of any sort.

1 Answer, 1 is accepted

Sort by
0
Alexander
Top achievements
Rank 1
answered on 02 Jul 2014, 05:07 PM
Found out my entire page was being wrapped inside another module that was messing it up. When I turned off the AJAX on that side, all worked just fine.
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Alexander
Top achievements
Rank 1
Share this question
or