Comments (4)
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.
from shinydashboard.
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.
from shinydashboard.
I've pushed a fix. I'll also try to get it in the upstream AdminLTE sources.
from shinydashboard.
@wch
Hi Wiston, is there a way to call the show/hide events from a button?
I am using loops to dynamically generate a couple boxes. I want the user to be able to click a button to expand all / collapse all at their preference. Is there some syntax like updateBox(collapse=FALSE/TRUE)?
from shinydashboard.
Related Issues (20)
- Maximizing tabBox with a sidebar will add a horizontal Scrollbar to the box HOT 3
- Dashboard sidebar starts uncollapsed HOT 2
- SidebarMenu menuItem href elements contain the aria-selected tag HOT 1
- can not see my second tabitem after clicking action button HOT 1
- Error with publication of a Shiny App with R
- [Update request] The default icon for menuSubItem() "angle-double-right" is now "angles-right" in Font Awesome 6.0.0 HOT 5
- dynamic footer HOT 6
- FYI copyright on the shinydashboard website HOT 1
- dashboardPage shouldn't create <title> HTML tags if title = NULL HOT 1
- dashboardBody not showing when conditionalPanel is used HOT 1
- Toggling boxes to collapse has unexpected results with nested boxes HOT 1
- ShinyDash fails to render since R4.3 added to computer. HOT 3
- `shinydashboard::updateTabItems` not matching `shiny::updateTabsetPanel` HOT 2
- Why use unsecure AdminLTE? HOT 4
- Remove/hide footer from dashboard HOT 3
- Collapsible box not responding in my navbarPage Rshiny
- shinydashboard - "Get started" Tab [1 Link + 1 Typo] HOT 1
- shinydashboard - "Appearance" Tab [1 Punctuation]
- shinydashboard - "Behavior" Tab [1 Typo]
- I am using the R Package shinydashboard, now the dashboardSidebar is NOT showing in black background HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinydashboard.