When I try to edit the entries of an rhandsontable inside a Shiny app, the drop-down menus are cut short. Is there a way to make them fully expand like the date selectors in the rhandsontable tutorial? Here is the app.
library(rhandsontable)
library(shiny)
ui = fluidPage(rHandsontableOutput("data"))
server = function(input,output) {
df = data.frame(x = factor(letters[1:3], levels = letters))
values = reactiveValues(data = df)
observe({
req(input$data)
values$data = hot_to_r(input$data)
})
output$data = renderRHandsontable({
rhandsontable(values$data)
})
}
shinyApp(ui = ui, server = server)
It will work if you change the size of your rhandsontable
.
You could try:
library(rhandsontable)
library(shiny)
ui = fluidPage(rHandsontableOutput("data"))
server = function(input,output) {
df = data.frame(x = factor(letters[1:3], levels = letters))
values = reactiveValues(data = df)
observe({
req(input$data)
values$data = hot_to_r(input$data)
})
output$data = renderRHandsontable({
rhandsontable(values$data, height=500)
})
}
shinyApp(ui = ui, server = server)
EDIT: Based on this, you can use overflow = "visible"
. It seems to fix the issue.
ui = fluidPage(rHandsontableOutput("data"))
server = function(input,output) {
df = data.frame(x = factor(letters[1:3], levels = letters))
values = reactiveValues(data = df)
observe({
req(input$data)
values$data = hot_to_r(input$data)
})
output$data = renderRHandsontable({
rhandsontable(values$data, overflow = "visible")
})
}
shinyApp(ui = ui, server = server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With