[英]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.