How to remove 'highlight' of a row?
How to remove 'highlight' of a row?
Hi,
I tried modified example here https://datatables.net/examples/advanced_init/row_callback.html like
"createdRow": function ( row, data, index ) {
if ( data.highlight == 1 ) {
$('td', row).addClass('highlight');
}
}
. This marks a whole row ba changing each 'td' in 'tr'. However I want that on click on a row the highlighted text reverts to normal. I tried several possibilities but couldn't reset the class of each 'td' in row. Do you know any possibilities to do this without reinitializing the table?
Thanks!
This question has an accepted answers - jump to answer
Answers
Sounds like you just want to use
$('td', this).removeClass('highlight');
wherethis
is the row (i.e. in an event handler that is attached to the rows). Does that make sense?Allan
Works Allan, thanks a lot!