Comments (5)
Just ran into the same problem and had to revert to version 0.3.1 because of this :-(
(Well, or start the boxes as collapsed=FALSE)
from shinydashboard.
This sounds like maybe just a shown or hidden event needs to be triggered?
from shinydashboard.
Yup, it just needed those events to be triggered.
For future reference, here's a streamlined test app:
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
sidebarMenu(
menuItem("Inputs", icon = icon("bar-chart-o"), tabName = "tabOne"
)
)
),
dashboardBody(
tabItems(
tabItem("tabOne",
box(title = "Test Box One",
status = "success",
solidHeader = TRUE,
collapsible = TRUE,
collapsed = TRUE,
plotOutput("plot", height = 250),
verbatimTextOutput("boxOneText")
),
box(
actionButton("go", "Go")
)
)
)
)
)
server <- function(input, output) {
output$plot <- renderPlot({
cat(paste("plotting", input$go, "\n"))
plot(rnorm(1 + input$go), rnorm(1 + input$go))
})
output$boxOneText <- renderText({
paste("Go counter:", input$go)
})
}
shinyApp(ui, server)
from shinydashboard.
@wch
Currently, I am wrapping a DT table inside a box. If a user click a cell, it will trigger an cell_clicked observe event to do certain operation. Now I want to put a line to 'collapse the box' at the end of observe event.
However, if I setup a session variable and use it to trigger a redraw of the box, the dt table will disappear. (I guess shiny does not allow an object to be defined twice??)
Is there any function to update the status of collapse? something like updateTabsetPanel? I'm open to alternatives too.
server.R
sess$boxFlag <- FALSE
observeEvent(input$dt_summary_cell_clicked,{
isolate({
if(length(cellValue <-input$dt_summary_cell_clicked) == 0) return(invisible())
sess$boxFlag <- TRUE
})
})
ui.R
output$ui_box <- renderUI({
flag <- sess$boxFlag
isolate({
box(title = 'Summary', width = 12, status = 'primary', collapsible = TRUE, collapsed = flag,
dataTableOutput('dt_summary')
)
})
})
Let me know if more clarification is required.
from shinydashboard.
I have the same problem but when rendering on sidebarMenu
, am I doing anything wrong?
library('shiny')
library("shinydashboard")
header <- dashboardHeader()
sidebar <- dashboardSidebar(
sidebarMenu(
menuItem("Inputs", icon = icon("bar-chart-o"), tabName = "tabOne",
uiOutput('mymenu')
)
)
)
body <- dashboardBody(
h3('nothing here')
)
shinyApp(
ui = dashboardPage(header, sidebar, body),
server = function(input, output) {
output$mymenu <- renderUI({
checkboxGroupInput('mymenu', 'lettersMenu',
letters[1:5],
letters[1:5])
})
}
)
from shinydashboard.
Related Issues (20)
- 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
- `updateTabItems` not working when selecting dynamically rendered `menuSubItem` HOT 2
- sidebar id is not in input inside a RMarkdown HOT 3
- Mention this package is not meant to be used in conjunction with {bslib}
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.