c# - Disable Esc key on Kendo Window Popup -
i using kendoui controls javascript mvc. have popup window create "kendowindow". working fine, when press esc key automatically close. want disable esc key window popup can closed cancel button or close button.
here kendo window code.
var wndeditclient= $("#diveditclient") .kendowindow({ title: "edit client", modal: true, visible: false, resizable: false, width: 450, actions: ["close"] }).data("kendowindow"); wndeditclient.open();
please suggest.
i tried javascript keypress event , not work.
$(document).bind("keypress", function (e) { if (e.keycode == 27) { e.preventdefault(); } });
tried not working.
put before including first kendo window directive:
$(function () { kendo.ui.window.fn._keydown = function (originalfn) { var key_esc = 27; return function (e) { if (e.which !== key_esc) { originalfn.call(this, e); } }; }(kendo.ui.window.fn._keydown); });
(demo)
Comments
Post a Comment