Jquery DataTables - onClick function to get multiple cell values of specific columns
<p>I want to be able to click on a column cell and also retrieve the cell value of another defined column of the same row in order to store both values in an array which can be passed on.</p>

<p>Here's what I tried:</p>

<pre><code>$('#datatab tbody').on('click', 'tr td.lastname', function () {
    var data = dt.column(0).cell(this).data();
    console.log(data);
    var data1 = dt.columns([0, 1]).data();
    console.log(data1);

....
}
</code></pre>

<p>If the table had a lastname and firstname column (not always adjacent), I would need to grab those two cell values based on the column index for example or some css class.</p>

<p>Hope you can help me.</p>

<p>Thank you.</p>