I have implemented the ID attribute for rows in my datatable:
'createdRow': function (row, data, dataIndex) {
$(row).attr('id', data.json.unid);
}
Now, I am trying to retrieve the IDs under a button click:
action: function () {
var count = table
.rows({
selected: true
})
.ids();
alert("IDs: " + count)
for (i = 0; i < count.length; i++) {
alert("ID: " + count[i])
}
rpcService
.setIds(count
.toArray());
}
However, the alert shows "undefined" for the ID.
Here is an example of how a row is structured:
<tr id="FF97C3CFC0F5FA76C12583D1003EA028" role="row" class="odd selected">
<td class=" select-checkbox"> </td>
<td><a href="0/FF97C3CFC0F5FA76C12583D1003EA028?OpenDocument">Anne Weinstein</a></td>
<td>ORP B</td>
<td><a href="0/FF97C3CFC0F5FA76C12583D1003EA028?OpenDocument">Anne Weinstein</a></td>
<td>s41660</td>
</tr>
What could be causing this issue?