1

I am displaying a Telerik report in a Telerik MVC popup window which is instantiated in client-side code. Everything works fine the first time -- the report appears normally.

But if the window is closed (as it will be) and the user clicks for a second time the button on the page that opens the popup, the popup opens but no report content appears. Here is the client code:

$(document).ready(function () {

    $('#printButton').click(function () {
        var printPopup = $.telerik.window.create({
            title: "Resident Account Report",
            contentUrl: '/myApp/ReportPages/ReportPage.aspx' + '?rpt=myReport&ID=' + @Model.id,
            actions: ["Refresh", "Maximize", "Close"],
            height: 600,
            width: 1100,
            modal: true,
            resizable: true,
            draggable: true,
            scrollable: false,
            onRefresh: function () {
                var myWindow = $(this).data('tWindow');
                myWindow.center().open();
            }
        });
    });
});

Is the problem because the first popup instance still exists in the DOM and needs to be disposed?

4

2 回答 2

1

我相信你上面解释的问题正是原因。关闭 MVC 弹出窗口不会释放加载到 MVC 弹出窗口中的对象。因此,您要么为每个弹出窗口处理并重新加载报告模块,要么仅使用将报告内容从原始页面导出到您的弹出窗口,这样您的内容将始终位于父窗口中,并且弹出窗口将仅用于查看导出的报告数据。

于 2012-06-19T19:48:03.840 回答
1

我知道这个问题已经有将近 1.5 年的历史了,但是我遇到了同样的问题并且我有解决方案,所以为将来会遇到这个问题的兄弟们分享解决方案。

就我而言,我从 Action 返回整个视图以响应 ajaxRequest()。在这种情况下,它还会返回所有与现有文件冲突的 JS 文件、CSS 文件等。

当我改变我的动作以返回部分视图时,一切都像魅力一样。

谢谢你,桑德什·达迪

于 2014-04-02T18:58:24.933 回答