i got issue with my datatable checkboxes submission , when i debug at controller laravel , it only shows 10 values which is current page , each page display 10 row
here is my code
var DT = $('#table-data-notice').DataTable(config);
$('#hantar').on('click', function(){
if ($('input:checkbox:checked').length == 0) {
swal('Amaran', 'Sila pilih sekurang-kurangnya satu notis', 'warning');
return false;
}
var $form = $('#verify-form');
var params = DT.$('input').serializeArray();
$.each(params, function(){
if(!$.contains(document, form[this.name])){
// If checkbox is checked
if(this.checked){
// Create a hidden element
$form.append(
$('<input>')
.attr('type', 'hidden')
.attr('name', this.name)
.val(this.value)
);
}
}
});
swal({
title: "Anda pasti?",
type: "warning",
showCancelButton: true,
confirmButtonText: '{!! __('Ya') !!}',
cancelButtonText: '{!! __('Tidak') !!}'
},
function(confirmed){
if (confirmed) {
$('#verify-form').removeAttr('data-success');
$('#verify-form').submit();
}
});
});
It should take all checked accross pages
2