Using Conditional Panel with PickerInput in R

☆樱花仙子☆ 提交于 2019-12-25 13:29:17

问题


In the given R shiny script below, I am trying to use a conditional panel with Picker Input shiny widget. There are three options in pickerInput, upon selection of "times" option, I wish to create new pickerInputs using a conditional panel, the following is possible using selectInput, but I need the same for Picker Input. Thanks and please help.

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Picket",titleWidth = 290),
dashboardSidebar(width = 0),
dashboardBody(
tabsetPanel(type = "tab",
            tabPanel("Overview", value = 1,

                     box(
                       column(1, 
                              dropdown(
                                pickerInput(inputId = "resources", 
                                            label = "", 
                                            choices = c("cases", 
                                                        "activities", 
                                                        "times"), 
                                            choicesOpt = list(icon = c("fa fa-bars", 
                                                                       "fa fa-bars", 
                                                                       "fa fa-safari")), 
                                            options = list(`icon-base` = "")),
                                circle = FALSE, status = "primary", icon = icon("list", lib = "glyphicon"), width = "300px"
                              ),
                              conditionalPanel(
                                condition = "input.Position == 'times' ",
                                dropdown(
                                pickerInput(inputId = "Id072", 
                                            label = "Select/deselect all options", 
                                            choices = c("A","Check-out", "b","c","d","e","f")
                                            )))))),

id= "tabselected"

            )

            ))


server <- function(input, output) { 
}
shinyApp(ui, server)

回答1:


Shouldnt this condition = "input.Position == 'times' ", be condition = "input.resources == 'times' ",?



来源:https://stackoverflow.com/questions/49024653/using-conditional-panel-with-pickerinput-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!