Tengo una breve pregunta sobre (r)handsontable. ¿Es posible cambiar los bordes de las celdas usando el parámetro renderer de la función hot_col ? Traté de encontrar algo equivalente a td.style.background , pero no encontré nada en Google. Probé cosas como td.style.border pero no funcionó...
Si alguien tiene la respuesta, se lo agradecería!
Gracias por adelantado
library(shiny) library(rhandsontable) ui <- fluidPage( rHandsontableOutput('table') ) server <- function(input, output) { df <- data.frame(alphabet = letters[1:10], include = TRUE, include2 = FALSE) output$table <- rhandsontable::renderRHandsontable({ col_highlight <- 2 rhandsontable(df, height = 500) %>% hot_col(col_highlight, renderer = " function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.CheckboxRenderer.apply(this, arguments); var col_value = instance.getData()[row][1] if ( col_value ) { td.style.background = '#C3FA9A'; } if ( !col_value) { td.style.background ='#ff4d4d' }}") })} shinyApp(ui, server)La propiedad CSS es backgroundColor :
output$table <- rhandsontable::renderRHandsontable({ col_highlight <- 2 rhandsontable(df, height = 500) %>% hot_col( col_highlight, renderer = " function (instance, td, row, col, prop, value, cellProperties) { Handsontable.renderers.CheckboxRenderer.apply(this, arguments); var col_value = instance.getData()[row][1]; td.style.backgroundColor = col_value ? 'red': 'green'; td.style.borderStyle = 'solid'; td.style.borderWidth = col_value ? '2px' : '4px'; td.style.borderColor = col_value ? 'yellow' : 'crimson'; }" ) })