1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$('input[name="check_all"]').on('click', function(e){ //$('#datatable') var $this = $(this); //console.log($this.prop('checked')); //Get all rows of datatable var nNodes = $('input[name="users[]"]', d_table.fnGetNodes()); //nNodes.prop('checked', true); //console.log(nNodes); //return; if($this.prop('checked') == true){ nNodes.prop('checked', true); }else{ nNodes.prop('checked', false); } }); |
Reference: