Dear RStudio experts,
Upon selection of 2 inputs, the number of rows in the rHandsontable varies, and I wish to select and highlight all the rows of the last column. I am using reactive to count the total rows for the selected inputs:
total_rows <- reactive({
TemperatureLimits <- TemperatureLimits %>%
dplyr::filter(ProfileID==input$temperature_section) %>%
dplyr::filter(ExtruderNo==input$temperature_extruder)
totalrows <- nrow(TemperatureLimits)
})
output$totalrows_text <- renderText(total_rows())
Above is able to show the correct different number of rows when the input changes. However, when I use the reactive function to highlight the number of rows, it does not behave as what is intended.
output$TemperatureLimits <- renderRHandsontable({
TemperatureLimits <- TemperatureLimits %>%
dplyr::filter(ProfileID==input$temperature_section) %>%
dplyr::filter(ExtruderNo==input$temperature_extruder)
rhandsontable(TemperatureLimits,selectCallback = TRUE,readOnly = FALSE,
width = 600, height = 300,col_highlight = 6,rowHeaders = NULL) %>%
hot_col("Line", readOnly = TRUE) %>%
hot_col("ProfileID",readOnly = TRUE ) %>%
hot_col("ExtruderNo", readOnly = TRUE) %>%
hot_col("Location", readOnly = TRUE) %>%
hot_col("Type",readOnly = TRUE ) %>%
hot_table(customBorders = list(list(
range = list(from = list(row = 0, col = 5),
to = list(row = total_rows()-1, col = 5)),
top = list(width = 2, color = "red"),
left = list(width = 2, color = "red"),
bottom = list(width = 2, color = "red"),
right = list(width = 2, color = "red")))) %>%
hot_table(stretchH = "all", highlightCol = TRUE)
})
The first output with 10 rows has it highlighted rows properly done here.
But for the second output here, it has 6 rows, but its highlighted rows is not correct. I need a close red rectangle box, but its bottom red line is missing.
Any idea what went wrong here?
Thanks.