根据 this page ,我所要做的就是从窗口的内容中调用以下代码,因为我没有使用 iframe:
$(buttonInsideWindow).closest(".k-window-content").data("kendoWindow").close();
这是行不通的。当我尝试从控制台手动关闭它时,它会在您尝试检索 kendoWindow 时返回 null。 (也就是说,当 $(buttonInsideWindow).closest(".k-window-content")
被调用但 .data("kendoWindow")
时它返回正确的 div > 在它上面返回 null)。
我在窗口内容中使用自定义按钮,它手动调用关闭事件。这就是我首先调用窗口的方式:
function otherCusLogInWindow_Open()
{
var otherCusLogInWindow = $("#otherCusLogInWindow");
otherCusLogInWindow.kendoWindow({
width: "535px",
height: "850px",
title: "ASDF",
modal: true,
actions: ["Minimize", "Maximize", "Close"],
content: "otherCusLogIn.jsp",
iframe: false,
visible: false,
draggable: true,
resizable: true
}).data("kendoWindow").center().open();
}
在窗口内容内部,关闭事件是微不足道的:
function closeWindow(parentFuncCall) {
$("#otherCusLogInWindow").closest(".k-window-content").data("kendoWindow").close();
}
只是为了解决这个问题,由于其他原因我无法使用 iframe。我需要让它在当前状态下工作。
我该如何解决这个问题?
最佳答案
试试这个:
$("#otherCusLogInWindow").data("kendoWindow").close();
这是有关获取客户端对象引用的文档:http://docs.kendoui.com/getting-started/web/window/overview#accessing-an-existing-window
关于javascript - 无法从 Kendo Window 中的内容关闭窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15676005/