title: How to Get Data from checkbox selected row in dataTables
body: <p>I'm using this <a href="https://datatables.net/extensions/select/examples/initialisation/checkbox.html" rel="nofollow noreferrer">data table</a>. </p>
  
  <p>I need to get both <code>ProductID</code> &amp; <code>ProductStatus</code> from the selected row where ProductID is embedded in the TR ID of each row. </p>
  
  <p>I'm not displaying the productStatus in the table. But I need to get the status when the row is selected. Where can i add them ?</p>
  
  <p>Please Guide me ....</p>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>function loadClick() {
  
    const databaseRef = firebase.database().ref('S01/Products');
    var query = databaseRef.orderByKey().startAt("C09M03S03").endAt("C09M03S04").limitToFirst(6);
  
    query.once("value")
      .then(function (snapshot) {
        snapshot.forEach(function (childSnapshot) {
  
          var t = $('#products_table').DataTable();
  
          var key = childSnapshot.key;
  
          var MID = childSnapshot.child("productMID").val();
          var SID = childSnapshot.child("productSID").val();
          var ProductID = childSnapshot.child("productID").val();
          var name = childSnapshot.child("productName").val();
          var unit = childSnapshot.child("productUnit").val();
          var productMRP = childSnapshot.child("productMRP").val();
          var price = childSnapshot.child("productSellingPrice").val();
          var buying_price = childSnapshot.child("productBuyingPrice").val();
          var productstatus = childSnapshot.child("productStatus").val();
  
          var row = "";
  
          t.row.add(['&lt;td class="cell-60 responsive-hide"&gt;&lt;/td&gt;&lt;td class="cell-300"&gt;&lt;a class="avatar" href="javascript:void(0)"&gt;&lt;img class="img-responsive" src="../../../global/portraits/1.jpg"alt="..."&gt;&lt;/a&gt;&lt;/td&gt;', '&lt;td&gt;' + name + '&lt;/td&gt;',
          '&lt;td&gt;' + unit + '&lt;/td&gt;', '&lt;td tabindex="1"&gt;' + productMRP + '&lt;/td&gt;', '&lt;td tabindex="2"&gt;' + price + '&lt;\/td&gt;',
          '&lt;td tabindex="3"&gt;' + buying_price + '&lt;\/td&gt;']).node().id = ProductID;
          t.draw(false);
  
        });
      });
  }
  
  function EditProdStatus(ProductID, ProductStatus) {
    var statusRef = firebase.database().ref('S01/Products').child(ProductID).child("productStatus");
    statusRef.set(!ProductStatus);
    console.log("Product Status changed to " + ProductStatus);
  }
  
  $(document).ready(function () {
    loadClick();
    var table = $('#products_table').DataTable({
      'columnDefs': [{
        orderable: false,
        className: 'select-checkbox',
        targets: 0
      },
      {
        'targets': 3,
        'createdCell': function (td, cellData, rowData, row, col) {
          $(td).attr('tabindex', '1');
        }
      },
      {
        'targets': 4,
        'createdCell': function (td, cellData, rowData, row, col) {
          $(td).attr('tabindex', '2');
        }
      },
      {
        'targets': 5,
        'createdCell': function (td, cellData, rowData, row, col) {
          $(td).attr('tabindex', '3');
        }
      }
      ],
      select: {
        style: 'os',
        selector: 'td:first-child'
      },
      order: [[1, 'asc']]
    });
  
  });
  
  function productDisable() {
  
    var oTable = $('#products_table').dataTable();
    $(".select-checkbox:checked", oTable.fnGetNodes()).each(function () {
      console.log($(this).val());
    });
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>   &lt;table id="products_table" class="table is-indent tablesaw" cellspacing="0" width="100%"&gt;
                        &lt;thead&gt;
                              &lt;tr&gt;
                                    &lt;th class="pre-cell"&gt;&lt;/th&gt;
                                    &lt;th class="cell-300" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="3"&gt;Product Name&lt;/th&gt;
                                    &lt;th class="cell-300" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4"&gt;Product Unit&lt;/th&gt;
                                    &lt;th class="cell-300" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4"&gt;Product MRP&lt;/th&gt;
                                    &lt;th class="cell-300" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4"&gt;Selling Price&lt;/th&gt;
                                    &lt;th class="cell-300" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4"&gt;Buying Price&lt;/th&gt;
                              &lt;/tr&gt;
                        &lt;/thead&gt;
                  &lt;/table&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/ArulNadhaN/vjqj7eg5/1/" rel="nofollow noreferrer">jsFiddle Demo</a></p>