1

i'm using dataTable plugin.

  • i want to edit or delete the particular row, so onclick on <td> iam planning to capture id.

but the problem when i go to next tab onclick is not working. it is working only for the present item.

here is a fiddle : http://jsfiddle.net/UvjnT/1191/

Please click on the item and see the alert. Then go to next tab, click but will not work? Why?

Andreas
  • 20,797
  • 7
  • 44
  • 55

1 Answers1

1

Try this code. You can see difference between .click() and .on("click") here

$(document).ready(function() {
   $('#example').dataTable({"sPaginationType": "full_numbers"});
   $('#example').on("click","td",function(){
     alert($(this).text());
   });
});
Community
  • 1
  • 1
Rakesh Sojitra
  • 3,318
  • 2
  • 14
  • 31