I am using jQuery and datatables. I want to add a class to the TR element of a particular row. I know how to find the row. The console.dir(row);
shows the r
To set a class name on the ref: https://datatables.net/reference/option/createdRow To set a class on the Something similar for 'columnDefs' ref: https://datatables.net/reference/option/columns.className To set the Id attribute on the row use this calback
createdRow: function (row, data, dataIndex) {
$(row).addClass('some-class-name');
},
use
"columns": [
{
data:"",
className: "my_class",
render: function (data, type, row) { return "..."; }
},
{
data:"",
className: "my_class",
render: function (data, type, row) { return "..."; }
},
//...
]
use:
//....
rowId: "ShipmentId",
columns: [...],
//....