2017-07-06 116 views
0

我有一個Kendo網格,它有一個彈出式編輯器,當我點擊編輯時,它彈出一個編輯框,我可以編輯字段,在編輯器中我有文本框這是動態創建,如何訪問它們,因爲我的代碼是正確的,但沒反應我得到的,這裏是我的領域和到底是我的代碼:?訪問Kendo彈出編輯器輸入文本框

columns: [ 
               { field: 'userName', title: 'userName', width: '100px'}, 
               { field: 'Password', title: 'Password', width: '80px' }, 

               { command: ["edit"], title: " ", width: "100px" }], 
         editable: "popup", 



$('[name="userName"]').click(function() { 

     alert("you can not edit username"); 
    }); 

回答

0

您應該edit內掛鉤的click功能電網本身的功能:

edit: function(e) { 
    $('[name="userName"]').click(function() { 
     alert("you can not edit username"); 
    }); 
}, 

這裏是一個Dojo example來說明上述的行動。

+0

這真的是一個很大的幫助,讚賞 – mortezasol

0

您也可以隱藏你的元素,以防止訪問:

edit: function(e) {       
e.container.find("input[name=userName]").parent().hide(); }