Checkbox problem with data table

Checkbox problem with data table

saudagarrizwansaudagarrizwan Posts: 8Questions: 1Answers: 0
edited February 2014 in DataTables 1.10
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
[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');
});
[/code]
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.

Replies

  • bicklebickle Posts: 8Questions: 0Answers: 0
    Maybe similar to this?: http://datatables.net/forums/discussion/14151/checkbox-select-checkboxes-all-only-works-once/p1

    Try changing attr to prop
This discussion has been closed.