小编sgk*_*knr的帖子

无法使用 Shinyjs() 禁用闪亮的应用程序单选按钮

我试图在input$Product !=A && input$month !="All"使用 Shinyjs 包时禁用闪亮的应用程序单选按钮(“趋势”),但没有成功。

我的 ui 页面定义为:

ui <- fluidPage(
   shinyjs::useShinyjs(),
   pageWithSidebar(
   titlePanel("Analytics"),

    sidebarPanel(
      selectInput("product",
              label = "Choose a Product",
              choices = list("A", "B", "C", "All")),

      selectInput("month",
              label = "Choose TimeFrame",
              choices = list("June", "July", "August", "September", "All")),

      radioButtons('ptype', label ="Plot Type",
                c(Histogram = 'histogram',
                  Box = 'boxp',
                  Trend = 'trendp')
               )

),
Run Code Online (Sandbox Code Playgroud)

我的服务器端代码:

 shinyServer(function (input, output, session) {

  mydata<- read.csv("mydataQ1fy16.csv")

  observe({shinyjs::toggleState("trendp", input$product != "A" && input$month != "All") })    

    getMonthproduct <- reactive( {
      if(input$month …
Run Code Online (Sandbox Code Playgroud)

r shiny shinyjs

3
推荐指数
1
解决办法
1550
查看次数

标签 统计

r ×1

shiny ×1

shinyjs ×1