[英]conditionalPanel seems not working at shinydashboard?
ConditionalPanel
似乎无法与shinydashboard
一起使用, input
变量如图所示,但我无法关闭conditionalPanel
块下的slideInput
。
对我来说很奇怪,请指教。 这是我的最佳示例
library(shiny)
library(shinydashboard)
ui <-
dashboardPage(
dashboardHeader(title = ""),
dashboardSidebar(
checkboxInput("chk", label = "checkBox",value = FALSE ),
conditionalPanel(condition = "input.chk ==TRUE",
sliderInput("slide", label = "test", min = 0, max = 10, value = 5))
),
dashboardBody(
textOutput("result"),
textOutput("checked")
)
)
server <-
function(input, output, session) {
result <- reactive(ifelse(input$slide >5, " greater than 5", "smaller than 5"))
output$result <- renderText(result())
output$checked <- renderText(input$chk)
}
shinyApp(ui, server)
经过几个小时的搜索,结果证明是非常直截了当的。
condition = "input.chk ==1"
并解决了我的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.