【发布时间】:2015-11-13 07:24:50
【问题描述】:
我正在尝试在输入更改时以编程方式折叠框。看来我只需要将类"collapsed-box" 添加到盒子中,我尝试使用shinyjs 函数addClass,但我不知道该怎么做,因为盒子没有id。这里是简单的基本代码,可用于测试可能的解决方案:
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
box(collapsible = TRUE,p("Test")),
actionButton("bt1", "Collapse")
)
)
server <- function(input, output) {
observeEvent(input$bt1, {
# collapse the box
})
}
shinyApp(ui, server)
【问题讨论】:
标签: shiny shinydashboard shinyjs