Highlighting non-valid data?
Highlighting non-valid data?
Hi, folks!
I'd like to know if it's possible to somehow highlight cells that contain non-valid data.
For example, by adding a class of "non-valid" to any <td> that contains non-valid data.
Test case:
https://jsfiddle.net/simisker/byd9z420/8/
Here, you can see that Ashton Cox's "email address" fails an email validation check, and so the appropriate cell is highlighted to the user. Is this possible?
[apologies in advance if I'm asking something either utterly trivial or fiendishly complex!]
This question has an accepted answers - jump to answer
Answers
You can use rowCallback for this:
https://datatables.net/reference/option/rowCallback
Well, that was quick and painless! I'll investigate further. Thank you!