如何在Jtable的自定义输入和display()中使用jquery?

时间:2015-12-23 06:33:35

标签: javascript jquery jquery-jtable

display()

   hehe:{
   display: function (data) {
   $t='<button id="tow"></button>';
   return $t;   
   } 

输入()

empid:{
input: function (data) {
if (data.record) {
return '<input type="text" id="empid"/>';    }}

$("#tow").click$("#empid").click不起作用。在返回之前绑定点击事件也不起作用。

我可以这样做。

onclick="myfunc(this)"

但我仍然需要jquery。

1 个答案:

答案 0 :(得分:1)

我认为您需要使用event delegation technique,如下所示:

$(document).on("click", "#tow", function(){
   //do something here
});

$(document).on("click", "#empid", function(){
   //do something here
});