[Fixed]-Javascript not working after Datatable Filter or Paging

1👍

You should delegate click event to closest static container:

$('#dt-invoice').on('click', '[id^=id_paid-]', function() {
  console.log("HERE")
  row = $(this).closest('tr');
  trid = row.attr("id");
  alert(trid);
});

The reason your click event was ignored is because at time you are binding it, only available matching elements in DOM get the event bound. Datatable plugin modify the table content, removing/adding new elements on paging/filtering. By binding it to table element (the closest static one), you handle all these dynamic elements too.

[References]

Leave a comment