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
console.dir(row);
r
You would just have to use the createdRow
$('#data-table').DataTable( { createdRow: function( row, data, dataIndex ) { // Set the data-status attribute, and add a class $( row ).find('td:eq(0)') .attr('data-status', data.status ? 'locked' : 'unlocked') .addClass('asset-context box'); } } );