I use datatable
A typical row is
<tr>
<td data-id="1">Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
I created an example
Init of the table
var table = $('#example').DataTable({
responsive: true
});
When I click on a row, I would like to get data attritube id, actually I get column value (Tiger, System...)
$('#example tbody').on('click', 'tr', function() {
//get only value of td... not data attribute
var data = table.row(this).data();
});
table.on('select', function (e, dt, type, indexes) { console.log(table.rows(indexes).data()) });selectevent only gives you the last selected row(s). You will have to calculate the list of selected rows by yourself in case of multiselect.