Disable Selectize Input Shiny

I have another problem with my brilliant app. The goal is to disable some inputs in my application when the user clicks the actionButton button. I found this solution that works great for text inputs and numeric inputs, but, oddly enough, not for selectinput or selectizeinput. I know that the solution contains somehow using javascript, but I donโ€™t know how to do it.

Thanks in advance for your help!

Edit:

Perhaps I did not clarify the situation clearly enough. Sorry guys! I will add the necessary pieces of code.

This is the disable function from the link. It works great with actionButtons and numerical inputs, but not with selection or selection of Input.

 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, . , hide = true oder 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"))

, select/selectize-Inputs?

.:)

+4
1

: shinyjs - shinyjs::disable(id), .


, : , selectize , HTML, HTML, disabled HTML. JS, selectize.js, .: (

selectize (selectInput(selectize = FALSE)), .

+4

All Articles