Am using datatable with checkbox. have serveral checkbox with two type of class name.Need to check all checkbox based on class name
This is my code :-
var exampless = $('.table1').DataTable({
responsive: true,
"searching": false,
"ordering": false,
"lengthChange": false,
"bInfo" : false,
className: 'select-checkbox',
});
$(".alluser").click(function () {
var cols = exampless.column(0).nodes(),
state = this.checked;
for (var i = 0; i < cols.length; i += 1) {
cols[i].querySelector(".User").checked = state;
}
});
Getting this error
TypeError: cols[i].querySelector(...) is null
Aucun commentaire:
Enregistrer un commentaire