试图将剑道窗口移动到中心。如果我使用 myModal.center().open(),它会以某种方式将它从中心向右下方移动一点。如果我使用 position: { left: "50%", top: "60%"},它确实居中但只是针对这个特定的屏幕。当我使用在其他窗口使用的相同控件时,它不在中心。还有其他选项可以让这个该死的窗口居中吗?
最佳答案
我在使用 Kendo Window 时遇到了类似的问题。我使用 Kendo Window Activate 事件使窗口居中。
.Events(eve => eve.Activate("centerKendoWindow"))
事件:
function centerKendoWindow(e) {
this.center();
}
如果您在 Kendo Window 中使用 Kendo Grid,那么您必须确保 centerKendoWindow() 在数据绑定(bind)到网格之前不会触发。
如果是这种情况,那么您可以使用 Kendo Grid DataBound 事件使窗口居中。
网格数据绑定(bind)事件
.Events(eve => eve.DataBound("onDataBound"))
中心剑道窗口
function onDataBound(args) {
var grid = $("#kendoaccountgridwindow").data("kendoWindow");
grid.center();
}
关于jquery - 如何居中 Kendo 窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32509961/