HTML
<div class="box">
<table id="Datatable">
<thead>
<tr>
<th><input name="checkall" type="checkbox" class="checkall" value="ON" /></th>
<th>field</th>
<th>field</th>
<th>field</th>
<th>field</th>
<th>field</th>
</tr>
</thead>
<tbody>
<tr>
<th class="checkers"><input type="checkbox" name="selected[]"/></th>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
<td>value</td>
</tr>
</tbody>
</table>
</div>
I’m trying to make the checkall checkbox selects all the checkboxes using this code:
$('.checkall').click(function () {
var checkall =$(this).parents('.box:eq(0)').find(':checkbox').attr('checked', this.checked);
$.uniform.update(checkall);
});
As datatable shows the first 10,20,30 … etc rows and removes the others from the DOM to do the pagination, this jQuery code only selects the rows in the current page. So is there anyway that I can select all checkboxes?
i found the solution