javascriptkendo-uikendo-window

Kendo UI - Pop up window


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

Solution

  • 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