-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collapsing of boxes not working with dynamic output #17
Comments
I had a look at your code and think I've found a fix. Basically, move the box() into dashboardBody(), and just have the content of the box in output$ui. Here's some code, with an extra box() added just for fun: library("shinydashboard")
body <- dashboardBody(
box(title = "Collapse Me",
width = 6,
status = "warning",
solidHeader = TRUE,
collapsible = TRUE,
uiOutput("ui")
),
box(title = "Collapse Me Too!",
width = 6,
status = "success",
solidHeader = TRUE,
collapsible = TRUE,
uiOutput("uiToo")
)
)
server <- function(input, output) {
output$ui <- renderUI({
paste("Click to see the box collapse")
})
output$uiToo <- renderUI({
paste("Click to see another box collapse")
})
}
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
body
),
server = server
) I hope that helps. As an aside, if you use the "height" attribute within the box(), just the content within the box collapses and not the box() itself, which is somewhat interesting. |
I think the root of the problem is that the Javascript code expects that the various components only need to be initialized when the page is loaded. I'll see what can be done. |
I've pushed a fix. I'll also try to get it in the upstream AdminLTE sources. |
@wch |
When I generate a box with collapsible=TRUE on the server side, the collapse button doesn't work anymore - even if the box has no content at all:
Would be great if you can get this to work as it is a quite common use case.
Best regards,
Robert
The text was updated successfully, but these errors were encountered: