Vote count: 0
i set the limit of selectable checkbox to 2. but if i select a checkbox on the first page of the table and select another on a different page, only one checkbox value is selected/pass when i submitted the form.
what should i do to get all selected checkbox value even from other page?
$(document).ready(function() {
var $datatable = $('#datatable-checkbox');
$datatable.dataTable({
'order': [[1, 'asc']]
});
var limit = 2;
$datatable.on('draw.dt', function() {
$('input').iCheck({
checkboxClass: 'icheckbox_flat-green'
});
});
$datatable.on('ifChecked', '.flat', function() {
var checkboxes = $datatable.DataTable().$("input:checkbox");
var $this = $(this);
if (checkboxes.filter(":checked").length > limit) {
swal({
title: "Book Limit Reached",
text: "",
type: "warning",
});
setTimeout(function() {
$this.iCheck('uncheck');
}, 1);
}
});});
asked 39 secs ago
how to get all selected checkbox value from different page in table? (icheck)(checkbox value from other page)
Aucun commentaire:
Enregistrer un commentaire