In an RShiny app, I am receiving the warning message Warning message: The select input "the_input_id" contains a large number of options; consider using server-side selectize for massively improved performance. See the Details section of the ?selectizeInput help topic.
I have a named vector namelist of length == 3000 that is used for the dropdown choices. I've tried the following two things to get rid of this warning:
ui
selectizeInput(
inputId = 'the_input_id', label = 'Player 1 Search:', choices = namelist, selected = NULL,
options = list(placeholder = 'Please select an option below', onInitialize = I('function() { this.setValue(""); }'))
)
uiOutput(outputId = 'this_id')
server
updateSelectizeInput(session = session, inputId = 'the_input_id', label = 'Player 1 Search:', choices = namelist, server = TRUE,
options = list(placeholder = 'Please select an option below', onInitialize = I('function() { this.setValue(""); }')),
selected = ""
)
output$this_id<-renderUI ({
selectizeInput(inputId = 'this_id', "Player 2 Search:", namelist,
options = list(
placeholder = 'Please select an option below',
onInitialize = I('function() { this.setValue(""); }')
))
})
The approach for the_input_id is to use a selectizeInput() in the UI, and an updateSelectizeInput() in the server (I thought this was the correct approach for server-side selectize). The approach for this_id is to use an uiOutput() in the UI, and a renderUI + selectizeInput on the server. Both of these approaches give the same warning message that I posted above. How can I resolve the issue / to get rid of this warning message.