在 R 中将条件面板与 PickerInput 结合使用
Using Conditional Panel with PickerInput in R
在下面给定的 R shiny 脚本中,我正在尝试使用带有 Picker Input shiny 小部件的条件面板。 pickerInput 中有三个选项,在选择 "times" 选项后,我希望使用条件面板创建新的 pickerInputs,使用 selectInput 可以实现以下内容,但我需要同样的选择器输入。谢谢,请帮忙。
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)
这个condition = "input.Position == 'times' ",
b condition = "input.resources == 'times' ",
不应该吗?
在下面给定的 R shiny 脚本中,我正在尝试使用带有 Picker Input shiny 小部件的条件面板。 pickerInput 中有三个选项,在选择 "times" 选项后,我希望使用条件面板创建新的 pickerInputs,使用 selectInput 可以实现以下内容,但我需要同样的选择器输入。谢谢,请帮忙。
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)
这个condition = "input.Position == 'times' ",
b condition = "input.resources == 'times' ",
不应该吗?