Telerik MVC WIndow Control - 第二次单击按钮时不显示弹出窗口
我有一个页面,我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在关闭窗口时删除内部 HTML。像这样:
其中“myWindow”是 telerik 窗口,“mainDiv”是包含窗口中创建的所有元素的 div。
You should remove the inner HTML on close the window. Like this:
Where "myWindow" is the telerik window and "mainDiv" is the div that contais all elements created in your window.
更改onclose事件的语句顺序并将变量设置为null以完全销毁窗口
change the order of statement of onclose event and set the variable to null to completely destroy the window