Rizwan Ahmed
Rizwan Ahmed

Reputation: 470

Kendo ui - disabling window dragging

Can we disable drag for kendo ui's window http://demos.kendoui.com/web/window/index.html?

 var wnd1 = $("#window1");
     var wnd2 = $("#window2");
     wnd1.kendoWindow({
         width: "505px",
         height: "315px",
         title: "Window 1",
         iframe: false,
         content: "/Portal/LiveFeeds",
         resizable: false,
         open: function (e) {
             this.wrapper.css({ left: 10 });
             $(this.wrapper).find(".k-window-action").css("visibility", "hidden");
         }
     });
     wnd2.kendoWindow({
         width: "505px",
         height: "315px",
         title: "Window 2",
         iframe: false,
         content: "/Portal/Cases",
         resizable: false,
         open: function (e) {
             this.wrapper.css({ left: 525 });
             $(this.wrapper).find(".k-window-action").css("visibility", "hidden");
         }
     });

I was able to hide the X the button at top right - but i am not able to disable the drag event.

Also,

I have tried following:

$('#window1').removeData('kendoDraggable');
     $('#window1').removeData('role');
     $('#window1').unbind('mousedown');
     $('#window1').unbind('selectstart');

But no luck. Any pointers would be helpful...

Upvotes: 5

Views: 6611

Answers (1)

Atanas Korchev
Atanas Korchev

Reputation: 30661

You should set the draggable option to false.

$("#div1").kendoWindow({
  draggable: false
});

And here is a live demo: http://jsbin.com/OseCeBu/1/edit

Upvotes: 6

Related Questions