Hi there,
I am struggling with downloadButton in shiny. It's not fitting itself into the sidebarPanel. I'm sure I'm missing something here. I want to use fluidRow >> column architecture. But it's not working with this. However, when I use sidebarLayout instead of fluidRow >> column it works fine.
Any help will be highly appreciated.
Thanks.
library(shiny)
ui = fluidPage(
h1("Test"),
br(),
fluidRow(
# sidebarLayout(
column(6,
sidebarPanel(
selectizeInput("cyl",
label = "Cylinder" ,
choices = unique(mtcars$cyl),
selected = NULL
),
downloadButton("report", "Generate report for selected"),
br(),br(),
downloadButton("reportall", "Generate report for all")
)
),
column(6,
mainPanel(
DT::dataTableOutput('myTable1')
)
)
)
# )
)
server <- function(input, output) {
output$myTable1 <- DT::renderDataTable({
mtcars %>% filter(cyl == input$cyl)
})
}
shinyApp(ui = ui, server = server)