Select All checkbox not firing
Select All checkbox not firing
longestdrive
Posts: 9Questions: 5Answers: 0
Hi. I'm trying to include a checkbox to select all checkboxes in the table rows. I've placed the header in the table heading as follows in aoColumns:
{ 'bSortable': false, 'sTitle': "<label>Select All</label>
<input type='checkbox' id='selectall' class='form-control'></input>", 'sClass':'text-center'
},
I've then placed the event handler as follows:
"fnDrawCallback": function (oSettings) {
$("#selectall").toggle(function () {
alert("select all clicked");
$(".includeChk", oTable.fnGetNodes()).attr("checked", true);
}
, function () {
$(".includeChk", oTable.fnGetNodes()).attr("checked", false);
}
);
I cannot get the event to fire. The checkbox appears as expected but checking the box nothing happens - there's no console error.
Have I missed something here?
Thanks
This discussion has been closed.