rhandsontable
rhandsontable copied to clipboard
@jrowen I am having similar problems. When I use `hot_col("target_col", type = "dropdown" ...)`, it works just fine. When I use `hot_cols(renderer = "js here")` it conditionally highlights what I want. But it removes the dropdown arrow from `type = "dropdown"`. The type is still a dropdown (it works if I click the cell) but the arrow is missing. How do I fix that?
@jrowen I am having similar problems. When I use hot_col("target_col", type = "dropdown" ...)
, it works just fine. When I use hot_cols(renderer = "js here")
it conditionally highlights what I want. But it removes the dropdown arrow from type = "dropdown"
. The type is still a dropdown (it works if I click the cell) but the arrow is missing. How do I fix that?
Is there a way to make the dropdown arrow bold?
Originally posted by @cca32 in https://github.com/jrowen/rhandsontable/issues/184#issuecomment-478538082
I used DropdownRenderer like in the text below and it was able to make the arrows available.
renderer = "
function(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.DropdownRenderer.apply(this, arguments);
td.style.background = 'lightblue'}
"
awesome, it works !
rhandsontable(my_DF) %>%
hot_col(2:ncol(my_DF),type = "dropdown",source=choix)%>%
hot_cols(2:ncol(my_DF),renderer = "
function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.NumericRenderer.apply(this, arguments);
if (value == 'disponible') {
td.style.background = 'white';
} else if (value == 'occupé') {
td.style.background = 'lightblue';
} else if (value == 'occupé covid19') {
td.style.background = 'lightblue';
} else if (value == 'ventilation mécanique') {
td.style.background = 'red';
} else if (value == 'VM covid19') {
td.style.background = 'red';
} else if (value == 'non disponible') {
td.style.background = 'lightgrey';
}
Handsontable.renderers.DropdownRenderer.apply(this, arguments);
}")