我的闪亮应用程序有另一个问题。目标是当用户按下一个actionButton时禁用我的应用中的一些输入。我发现this解决方案,它适用于textinputs和数字输入,但奇怪的不是selectinput或selectizeinput。我知道解决方案包含JavaScript,但我不知道如何。禁用选择输入闪亮
在此先感谢您的帮助!
编辑:
也许我没有说清楚。对不起大家!我将添加必要的代码块。
这是链接的禁用功能。它适用于actionButtons和数字输入,但不适用于选择或选择输入。
disableActionButton <- function(id,session) {
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('disabled',true)"
,sep="")))
disableselectButton <- function(id,session) {
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('select',false)"
,sep="")))
disableselectButton <- function(id,session) {
session$sendCustomMessage(type="jsCode",
list(code= paste("$('#",id,"').prop('hide',false)"
,sep="")))
这是不被禁用的输入示例。正如我所说的,解决方案可能在于JavaScript,但我甚至不知道基本原理是诚实的。我已经尝试了不同的probs,如hide = true或者select = false,这些都不起作用(你可以看到上面没有的函数)。
selectInput("algorithmicMethod1",
label=h5("Berechnungsalgorithmus erster Wahl"),
c("RoT","Pickands"),
selected="RoT"),
conditionalPanel(condition="input.algorithmicMethod1 =='RoT'",
selectInput("algorithmicMethod2",
label=h5("Berechnungsalgorithmus zweiter Wahl"),
"Pickands",
selected="Pickands")),
conditionalPanel(condition="input.algorithmicMethod1 =='Pickands'",
selectInput("algorithmicMethod2",
label=h5("Berechnungsalgorithmus zweiter Wahl"),
"RoT",
selected="RoT"))
那么,有没有其他方法来禁用选择/选择输入?
再次感谢:)
我不知道为什么这个问题是downvoted,但也许你可以通过附加的几张截图使其更清晰 – Alex 2014-10-02 01:39:00
嘿, 没有人可以帮忙吗? 谢谢:) – Richard 2014-10-07 14:09:50