0

I want to update a selectInput item on a Shiny app with more than 1,000 items but it obviously don't accept more than 1,000.

Is there a method to add more values or load it from server, as user start typing? server parameter also doesn't work.

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(
  tags$head(tags$script(src = "message-handler.js")),

   # Application title
   titlePanel("Large selectInput"),

   # Sidebar with a slider input for number of bins 
   sidebarLayout(
      sidebarPanel(
         selectInput("Names",
                     "List of Names",
                     choices = c("A")
                     )
      ),
      mainPanel("Empty")
   )
)

# Define server logic required to draw a histogram
server <- function(input, output, session) {
  names <- 1:5000
  observe({
    updateSelectInput(session, "Names", label = "Updated", choices = names, server = TRUE)
  })
  }
# Run the application 
shinyApp(ui = ui, server = server)
Mehdi Zare
  • 1,221
  • 1
  • 16
  • 32

1 Answers1

0

selectizeInput() can handle more than 1,000 records.

Mehdi Zare
  • 1,221
  • 1
  • 16
  • 32
  • After setting the appropriate options: `selectizeInput(inputId = "myId", label = "myLabel", options = list(maxOptions = 100000L))`. – ismirsehregal Feb 23 '22 at 14:25