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.
Here's what I tried:
$('#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);
....
}
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.
Hope you can help me.
Thank you.