【发布时间】:2015-03-14 03:44:31
【问题描述】:
我有两个选择输入 用户界面 图书馆(闪亮)
ContextElements = c("choice1", "choice2", "choice3")
shinyUI(pageWithSidebar(
headerPanel(""),
sidebarPanel(
h4("test for selectize input"),
selectizeInput(inputId = "firstAxe", label = h4("First Axe"),
choices=ContextElements, selected = NULL, multiple = FALSE,
options = NULL),
hr(),
selectizeInput(inputId = "twoAxe", label = h4("Second Axe"),
choices=NULL, selected = NULL, multiple = FALSE,
options = NULL)
),
mainPanel(
)
))
我希望下一个 selectizeinput 选项(“twoAxe”)用第一个选项中剩余的选项动态填充,这意味着如果我选择了第一个选项,如果第一个选项,第二个选项将是选项 2 和选项 3
谢谢
【问题讨论】:
-
如果没有完整的代码可以使用,我想您可以在 server.R 端执行此操作,并带有某种反应性,其中包括
ContextElements_new <- ContextElements[!(ContextElements %in% input$firstAxe)]的效果但这只是一个猜测,需要一些修补。有人可能会提供更好的答案。或者,您可以包含 server.R 和 UI.r 的可重现代码,并且可能会出现更好/正确的解决方案。