how do I removeClasses from a single cell in a single row?

how do I removeClasses from a single cell in a single row?

thegamechangerprothegamechangerpro Posts: 81Questions: 30Answers: 1

I use the below for changing the class of a row, but I'm trying to accomplish the same thing for a single cell
First I get the rowId using a find and then apply the changes. What is the equivalent of this for a cell?

This an injection into a table so i can't build a test case because it runs in another program.

var rowId = $('#table').dataTable()
.fnFindCellRowIndexes('$pk', 0);

table.row(rowId).nodes().to$().removeClass('lightGreen');
table.row(rowId).nodes().to$().removeClass('lightAmber');
table.row(rowId).nodes().to$().addClass('$status');

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949
    edited April 2023 Answer ✓

    Use the cell() API to interact with one or more cells. More specifically cell().node() to apply and remove classes.

    Kevin

Sign In or Register to comment.