Kendo UI - 弹出 window

Kendo UI - Pop up window

我有 kendo window,我想将弹出窗口 kendo window 放在底部中央。现在,弹出窗口在中心打开。有人对此有什么建议吗?

JavaScript

$('input:radio[name="retailItem"]').change(function(){    
if($(this).val() == 'y'){

    wnd = $("#wnd");
    wnd.kendoWindow({
        visible: false,         
        width: "500px",
        height: "400px",
        resizable: false,   
        title: "Recipe" 
    }).data("kendoWindow").center().open(); 
//  alert("yes");
}   else if($(this).val() == 'n'){

    wnd = $("#wnd");
    wnd.kendoWindow({
        visible: false,         
        width: "500px",
        height: "400px",
        resizable: false,   
        title: "Recipe" 
    }).data("kendoWindow").center().close();
//  alert("no");
    }

也许你可以试试这个: Popup window position ignored when using template

您可以使用 setOptions() on the window's open event:

定位 window
wnd = $("#wnd");
wnd.kendoWindow({
  visible: false,
  width: "340px",
  height: "200px",
  resizable: false,   
  title: "Recipe",
  open: function(e) {
    var windom = e.sender.element.closest(".k-window");
    e.sender.setOptions({
         position: {
             top: $(window).scrollTop() + Math.max(0, ($(window).height() - windom.outerHeight(true))),
             left: $(window).scrollLeft() + Math.max(0, ($(window).width() - windom.outerWidth(true)) / 2)
         }
    });
  }
}).data("kendoWindow").open();

DEMO