Kendo UI - Pop up window

1.1k Views Asked by At

I have kendo window which I want to put the popup kendo window at bottom center. Right now, the popup open at center. Anyone have suggestion about that?

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");
    }
2

There are 2 best solutions below

0
ezanker On BEST ANSWER

You can position the window using setOptions() on the window's open event:

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

0
happybird On