直接上代碼
$(document).ready(function () {
$('#orChecked').change(function(){
if($(this).is(':checked')){
$('#box').find(':checkbox').prop('checked',true);
}else{
$('#box').find(':checkbox').prop('checked',false);
}
//數據處理
addCodeAll($(this).is(':checked'));
})
});
<table id="contentTable"
class="table table-striped table-vmiddle bootgrid-table">
<thead>
<tr>
<th class="col-xs-1">
<label class="checkbox checkbox-inline m-r-20" title="全選/取消全選">
<input type="checkbox" id="orChecked" />
<i class="input-helper"></i>
</label>
序號
</th>
</tr>
</thead>
<tbody id="box">
<c:forEach items="${pageList }" var="item" varStatus="status">
<tr>
<td >
<label class="checkbox checkbox-inline m-r-20">
<input type="checkbox"/>
<i class="input-helper"></i>
</label>
${(page.pageNo-1)*page.pageSize + status.count }
</td>
</tr>
</c:forEach>
</tbody>
</table>