Having troubles applying color to entire cell based on data.
Having troubles applying color to entire cell based on data.
So my idea is to apply a color to a cell based on the data in that cell. So I'm using a render function to apply a class and then in the initComplete, I'm applying a color to the parent, in this case the <tr>. Here is the strange thing, I'm doing this to 3 cells. 1 is working exactly the way I want, the other two are not. The strange thing is, datatables is applying the class without a problem, the javascript to then apply the color to the parent is not working in 2 of the 3 cases. Here is a screenshot of my code to show you what I mean:
Does anyone have any ideas what's going on here?
Answers
Have you looked at using
createdRow
orcolumns.createdCell
to apply the styling? These are meant for what you are trying to do.If you want us to take at the code you posted please provide a link to your page or a test case showing the issue so we can take a look at wha tis happening.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin