I have jquery datatable with 4 pages. When I load the page the click event works fine. From the second page onwards click event doesn't work. I read the http://api.jquery.com/on/ link, but I am confused making it work.
<table id="datatable">
<thead><th></th><th></th></thead>
<tbody></tbody>
</table>
$('#datatable tbody tr').find('td:gt(0):lt(9)').on("click", "", function(e) {
e.preventDefault();
e.stopPropagation.
});
The table loads as ajax client side, when I paginate the table is refreshed with new data. How to attach the click event to the next set of rows
Here is the link to jsfiddle
$('#datatable' tbody tr)
--- what's this? ps: you don't use delegation - your second parameter in theon()
call is an empty string – zerkms$('#datatable' tbody tr)
enables click for the rows in the tbody. the second parameter is empty because I didn't know what to include in that. – user525146$('#datatable tbody tr')
I changed the quote at the end oftr
– user525146