Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82226

Checkbox problem with data table

$
0
0
Am using datatables in my project. I have a checkbox on each row and contains paging and sorting. I am getting all the records at once. When I checked on check all it check all the check boxes. Am using the below code
$('#check_all').click( function(e) {
	var chkAll = $("#check_all").is(':checked');
	if(chkAll) $('input', oTable.fnGetNodes()).attr('checked', this.checked);
	else $('input', oTable.fnGetNodes()).removeAttr('checked');
});
When I uncheck and check again it does not checks the check boxes. But when do inspect element will see a property checked="checked", but check box is not showing as checked.

Conclusion: If we select check box first time and then uncheck it and then do check all. Earlier checked checkboxes will not work.
Can you please help me in this.

Viewing all articles
Browse latest Browse all 82226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>