2016-12-26 98 views
2

我用劍道UI彈出的編輯這樣:如何在彈出窗口外單擊時使kendo彈出編輯器AUTO-CLOSE?

editable: { 
     mode: "popup", 
     window: { 
      actions: [], 
      title: false, 
      modal: false, 
      resizable: false, 
      animation: false, 
      clickOutside: true 
     } 

我不`噸知道如果我可以在彈出的窗口自動關閉經過編輯的配置。

我已嘗試添加autoHide:trueautoClose: true配置,但它不`噸的工作。

回答

0

萬一任何一個慵懶的感覺,這裏是彈出編輯窗口怎麼會被關閉:

$(document).on('click', function (e) { 
    //kendo popup edit window selector 
    var windowCont = $('.k-popup-edit-form.k-window-content'); 

    //if it was first click on kendo grid edit button exit function 
    //otherwise popup window will be closed immidiatelly 
    if ($('.k-grid-edit').is(e.target)) 
     return; 

    //if click was outside popup window, trigger close button 
    if (!windowCont.is(e.target) && windowCont.has(e.target).length === 0) 
     windowCont.find('.k-grid-cancel').click(); 
}) 
相關問題