Mohit Kala

Mohit Kala

  • 571
  • 2.1k
  • 134.5k

DataTable Selected Row Checkbox Ids Not Working Properly

Jul 3 2018 5:14 AM
below is my datatable
 
 
 
When i Selected 2 rows it displays ids
using below code
$("#btn").on("click", function () {
debugger;
var id = $('#myDataTable2 input[type="checkbox"]:checked').map(function () {
return $(this).val();
}).get();
alert(id);
if (id.length === 0) {
swal('', 'Please Select Question', 'warning');
}
});
 
But When i Clicked To Second Page Using Pagination Then it not Get Ids  

Answers (4)