title: jquery Datatables checkbox get all checked rows
body: <p>I have a datatable in which in which I'm trying to get all the checked rows. This table has row grouping and uses a checkbox plugin from <a href="http://www.gyrocode.com/projects/jquery-datatables-checkboxes/" rel="nofollow noreferrer">gyrocode</a>. I've tried the code listed on the <a href="http://www.gyrocode.com/projects/jquery-datatables-checkboxes/reference/api/" rel="nofollow noreferrer">api</a>, but I had no luck. I only get the first record returned, regardless of what is selected. The code I used for the  is shown below:</p>
  
  <pre><code>var tbl;
  $(document).ready(function (){
            tbl = $('#example').DataTable({
              columnDefs: [{
                  targets: 0,
                  data: 2,
                  'checkboxes': {
                      'selectRow': true
                  }
              },
              { "visible": false, "targets": 1 }],
              select: {
                  style: 'multi'
              },
              order: [[1, 'asc']],
              iDisplayLength: 10,
              drawCallback: function () {
                  var api = this.api();
                  var rows = api.rows({ page: 'current' }).nodes();
                  var last = null;
  
                  api.column(1, { page: 'current' }).data().each(function (group, i) {
                      if (last !== group) {
                          $(rows).eq(i).before(
                              '&lt;tr class="group"&gt;&lt;td colspan="6"&gt;' + group + '&lt;/td&gt;&lt;/tr&gt;'
                          );
                          last = group;
                      }
                  });
              }
          });
  });
  
  function getSelected(){
      alert(tbl.columns().checkboxes.selected().length);
  }
  </code></pre>
  
  <p>I have the code in my <a href="https://jsfiddle.net/4jgvpLzo/7/" rel="nofollow noreferrer">jfiddle</a> here. I'm not sure if their is interence between the checkbox and the row grouping? Please let me know where I am going wrong.</p>
  
  <p>Note: The checkbox is based on the plugin by gyrocode The datatables is version 1.10.12</p>