Setting Row Color
Setting Row Color
This might have been asked before, but I don't see the answer in the forum. I want to change the row color after a user performs an update. Here is what I've tried. The rows have odd or even in the class
I get the row with var
_row = _mytable.row(_rowindex).node();
I've tried this but it messes up the formatting.
$(_row).removeClass().addClass('bg-success');
I've tried this below ,but the background color(odd,even) overrides the new class that I add.
$(_row).addClass('bg-success'),
I'm sure this is simple, but I can't figure it out. Can you point me in the right direction?
Answers
See if this example helps:
http://live.datatables.net/loheyupe/1/edit
Kevin
That is similar to what I'm doing. The problem I'm running into is The table is striped and has quite a bit of CSS. it has odd / even rows.
Do I need to create a class and force background-color !important ?
Hi @lesljr ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin