I'd like to apply color highlighting for a entire row depending on a value and retain check boxes functionality of rhandsontable. In the simple example below, I'd like row 3 to be pink and row 4 to be green.
library(rhandsontable)
DF = data.frame( bool = TRUE,val = 1:10, big = LETTERS[1:10],
small = letters[1:10],
stringsAsFactors = FALSE)
###Checkboxes not Present/Entire row not highlighted
rhandsontable(DF, readOnly = FALSE, width = 750, height = 300) %>%
hot_cols(renderer = "
function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.NumericRenderer.apply(this, arguments);
if (value == 'C') {
td.style.background = 'pink';
} else if (value == 'D') {
td.style.background = 'green';
}
}")
####Checkboxes Present
rhandsontable(DF, readOnly = FALSE, width = 750, height = 300)