Kendo window disable maximize on double-click

3.1k views Asked by At

Plunkr: http://plnkr.co/edit/LoMmQ3y4snPrELJz9ZSq?p=preview

Can anyone help me on how to disable maximization of the window by double-clicking on its title? I tried to disable the dblclick event with the following code, but it doesn't seem to work.

$(document).on('dblclick','.k-window-titlebar',function(e){
  e.preventDefault();
  console.log('dblclick');
  return false;
});
3

There are 3 answers

2
OnaBai On BEST ANSWER

This is not a nice solution but might work, try toggling back to the previous size:

// Window definition
var win = $("#win1").kendoWindow({
    width: "300px",
    height: "100px",
    title: "Window 1",
    actions: []
}).data("kendoWindow");

$(document).on('dblclick','.k-window-titlebar',function(e){
  // Restore old size
  win.toggleMaximization();
});
1
Alex On
// Window definition
var win = $("#win1").kendoWindow({
    width: "300px",
    height: "100px",
    title: "Window 1",
    actions: [],
    **resizable: false**
}).data("kendoWindow");

resizable: false - Will prevent from maximizing the window.

1
Phuc Thai On

The following code worked for me:

   // Window definition
var win = $("#win1").kendoWindow({
    width: "300px",
    height: "100px",
    title: "Window 1",
    actions: []
}).data("kendoWindow");

win.wrapper.children('.k-window-titlebar:first-child')
                       .dblclick(function (e) {                           
                           e.preventDefault();
                           return false;
                        });

Try this: http://plnkr.co/edit/kAhw2A?p=preview