1

我正在使用 radgrid。当我单击导出按钮时,Rad Ajax 加载面板会显示,但在导出过程完成后不会关闭。

你对这个问题有任何想法吗?

4

1 回答 1

1

嗨,我找到了我的解决方案 :) 我删除了 AjaxPanel 和 AjaxLoadingPanel 之间的连接。之后,我明确地触发了 AjaxLoadingPanel。这是我以前使用的代码。

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
     <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="btnList">
         <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
     </AjaxSettings>
     <ClientEvents OnRequestStart="ResponseEnd" />
</telerik:RadAjaxManager>

和java脚本

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    var currentLoadingPanel = null;
    var currentUpdatedControl = null;
    function ResponseEnd(sender, args) {
        //hide the loading panel and clean up the global variables
        if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
            args.set_enableAjax(false);
        }

        currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");

        if (args.get_eventTarget() == "<%= btnList.UniqueID %>") {
            currentUpdatedControl = "<%= RadAjaxPanel1.ClientID %>";
        }
        else {
            currentUpdatedControl = "<%= RadAjaxPanel1.ClientID %>";
        }
        if (currentLoadingPanel != null)
            currentLoadingPanel.hide(currentUpdatedControl);
        currentUpdatedControl = null;
        currentLoadingPanel = null;
    }
</script>

于 2012-08-23T05:44:26.047 回答