i am using bootstrap datatable for pagination.I also added click event to each row.But the click event fired only in the first page. It does not work after sorting or pagination.Here is my php code to display data
<table id='tblCustomers' class='table table-bordered table-striped'>
<thead>
<tr>
<th>Customer id</th>
<th>Company</th>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
<th>Last login</th>
<th>No Of logins </th>
</tr>
</thead>
<tbody>";
foreach ($this->result as $row) {
echo "<tr>
<td>{$row['customerid']} </td>
<td>{$row['company']} </td>
<td>{$row['firstname']} </td>
<td>{$row['lastname']} </td>
<td>{$row['email']} </td>
<td>{$row['lastlogin']} </td>
<td>{$row['count']}</td>
</tr>";
}
echo "</tbody></table>";
and the jquery code is
$(function () {
$("#tblCustomers").dataTable();
$("#tblCustomers tr").click(function(){
alert($(this).find('td:first').text());
});
});