Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 124

Select All checkbox not firing

$
0
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


Viewing all articles
Browse latest Browse all 124

Trending Articles