簡體   English   中英

條件面板似乎不能在閃亮儀表板上工作?

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM