Telerik MVC WIndow Control - 第二次单击按钮时不显示弹出窗口

发布于 2024-11-08 14:37:10 字数 999 浏览 5 评论 0原文

我有一个页面,我正在使用 Telerik 窗口使用 ajaxRequest 打开页面。它工作得很漂亮。然而,下次当我点击该按钮时,它什么也没做。下面是代码片段: var url = "/workbench/createscenario?opportunityid=" + opportunityid + "&customerid=" + customerid var window = $("#wndNewScenario").data("tWindow"); window.ajaxRequest(url); 窗口.center(); 窗口.open();

我什至尝试使用完整的客户端脚本,如下所示:

    var url = "/workbench/createscenario?opportunityid=" + opportunityid + "&customerid=" + customerid;

    var windowElement = $.telerik.window.create({
        title: "Form",
        html: '',
        contentUrl: url,
        modal: true,
        resizable: true,
        draggable: true,
        onClose: function (e) {
            alert("destroying");
            e.preventDefault();
            windowElement.destroy();

        },
        onRefresh: function (e) {
            windowElement.center();
        }

    }).data('tWindow');

    windowElement.center().open();

任何帮助将不胜感激......我真的不想尝试另一个弹出窗口

I have a page where I am using Telerik window to open a page using ajaxRequest. It work beautifully. However next time when I hit that button, it just doesn't do anything. Below is the code snippet:
var url = "/workbench/createscenario?opportunityid=" + opportunityid + "&customerid=" + customerid
var window = $("#wndNewScenario").data("tWindow");
window.ajaxRequest(url);
window.center();
window.open();

I even tried with full client side script as below:

    var url = "/workbench/createscenario?opportunityid=" + opportunityid + "&customerid=" + customerid;

    var windowElement = $.telerik.window.create({
        title: "Form",
        html: '',
        contentUrl: url,
        modal: true,
        resizable: true,
        draggable: true,
        onClose: function (e) {
            alert("destroying");
            e.preventDefault();
            windowElement.destroy();

        },
        onRefresh: function (e) {
            windowElement.center();
        }

    }).data('tWindow');

    windowElement.center().open();

Any help would be much appreciated ....I really don't want to try out another popup

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

朕就是辣么酷 2024-11-15 14:37:10

您应该在关闭窗口时删除内部 HTML。像这样:

onClose: function () {
                    myClass.myWindow = undefined;
                    if ($("#mainDiv") != undefined)
                        $("#mainDiv").remove();
                } 

其中“myWindow”是 telerik 窗口,“mainDiv”是包含窗口中创建的所有元素的 div。

You should remove the inner HTML on close the window. Like this:

onClose: function () {
                    myClass.myWindow = undefined;
                    if ($("#mainDiv") != undefined)
                        $("#mainDiv").remove();
                } 

Where "myWindow" is the telerik window and "mainDiv" is the div that contais all elements created in your window.

戈亓 2024-11-15 14:37:10

更改onclose事件的语句顺序并将变量设置为null以完全销毁窗口

var windowElement = $.telerik.window.create({

标题:“表格”,
    html: '',
    内容网址:网址,
    模态:真实,
    可调整大小:真实,
    可拖动:真实,
    onClose: 函数 (e) {
        windowElement.destroy();
        wndSendEmail = null;
        e.preventDefault();**
    },
    onRefresh:函数(e){
        windowElement.center();
    }

}).data('tWindow').center().open();

change the order of statement of onclose event and set the variable to null to completely destroy the window

var windowElement = $.telerik.window.create({

    title: "Form",
    html: '',
    contentUrl: url,
    modal: true,
    resizable: true,
    draggable: true,
    onClose: function (e) {
        windowElement.destroy();
        wndSendEmail = null;
        e.preventDefault();**
    },
    onRefresh: function (e) {
        windowElement.center();
    }

}).data('tWindow').center().open();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文