Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo ui - disabling window dragging

Tags:

kendo-ui

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...

like image 731
Rizwan Ahmed Avatar asked Aug 17 '13 05:08

Rizwan Ahmed


1 Answers

You should set the draggable option to false.

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

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

like image 72
Atanas Korchev Avatar answered Oct 02 '22 23:10

Atanas Korchev