dataTables does not respond to changes in the DOM, and magically updates its internal variables when a checkbox is checked. dataTables return in any case the content of <th>
's as it was when the table was initialized. Seen from a dataTables point of view, the content of the <th>
is just a peice of plain text.
Why go around dataTables anyway? The headers and the checkboxes are fully accessible in javascript or jQuery as always, with our without dataTables.
Here is an example -> http://jsfiddle.net/XTpKH/
var dataTable = $('#example').dataTable();
$('th').click(function() {
var msg = 'this header checkbox is ';
msg += $(this).find('input[type="checkbox"]').is(':checked') ? ' ' : 'not ';
msg +='checked'
alert(msg);
});