Search code examples
javascriptjqueryjquery-jtable

How to use jquery with Jtable's custom input and display()?


display()

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

input()

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

$("#tow").click and $("#empid").click doesn't work .Bind click event before return does't work too.

I can do it like this.

onclick="myfunc(this)"

But I still need jquery.


Solution

  • I think you need to use event delegation technique as follows:

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