I'm using the DataTables jQuery Plugin and have a click handler setup on row click as follows:
$('#dt tbody tr').click(function () {
alert('e');
});
This works perfectly for the first page of DataTables results.
However, when I move to another page of results, the click handler no longer registers at all.
My presumption is that the DataTables code is stopping the propogation of the click event to my handler, but as this is only occurring on pages after the first it seems unusual.
As such, has anyone:
- Encountered (and ideally resolved) this problem
- Found a good way to track jQuery/JS event propogation to isolate why the event is being stopped
Cheers
ajaxCompletewould bind to all rows, was invalid as DataTables is wise and does not render all rows in the browser until required. As such, Kon's answer oflive()is correct.