I have a sql query for my report that returns an id
column but I dont show it in the rendered table.
When I generate the Datatable I want to add the rows id
column to the td
attribute.
The below code doesn't work because I'm not showing the id
column in the table. But the id is there in the datastore.
"attributes" => [
"tr" => function($row, $colKey, $colMeta){ //edited: "td" -> "tr"
$row_imploded = implode(',', $row);
return [
"id-attrs" => $row['id']
];
}
],
How can I retrieve the corresponding id for that particular row?