getting specific data of selected row

getting specific data of selected row

yoanyoan Posts: 2Questions: 1Answers: 0

Hi everyone,

I'm desperately trying to get specific data from the selected rows.
I want to get the data-ID attribute of the second column of each selected rows, but I only have access to the content of the cell.
<tr> <th>Customer name</th> <th>City</th> <th>Amount</th> </tr>
<tr id="1234"> <td data-id="553">Jason</td> <td>Paris</td> <td>$140</td> </tr>
<tr id="1255"> <td data-id="704">Mike</td> <td>London</td> <td>$114</td> </tr>

var rows = table.rows({selected: true} ).data().toArray(); for (let i in rows) { console.log(JSON.stringify( rows[i][1] )); //shows Jason }
Any help please ?

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.