'; retur...">

How to use jquery with user input and Jtable () 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").clickand $("#empid").clickdoes not work. Replacing the click event before returning does not work either.

I can do it like this.

onclick="myfunc(this)"

But I still need jquery.

+4
source share
1 answer

I think you need to use event the delegation method as follows:

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

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

Source: https://habr.com/ru/post/1621387/


All Articles