I'd like to implement a conditional formating. E.g.
library(DT)
datatable(mtcars, options = list(
fnRowCallback = JS(
"function ( row, data, index ) {",
"if ( data[3] > 130 ) {",
"$(data[3]).css('background-color', '#078DC6');",
"}",
"else {",
"$(data[3]).css('background-color', '#FFDE00');",
"}",
"}")))
Here I want to change background of rows in terms of disp column.How to upgrade this? Right now this code does not change backgorund of rows at all.
R packageimplementing datables.More here.rstudio.github.io/DT/options.html