Shiny - How to select a whole group in PickerInput?

585 views Asked by At

The dropdown list in the dashboard I've given to the user is very lengthy.

I need the entire list under a group to be selected when the group is clicked.

The below is a sample script. Thanks...

library("shiny")
library("shinyWidgets")

ui <- fluidPage(
  br(),
  pickerInput(
    inputId = "p1",
    label = "Default",
    multiple = TRUE,
    choices = list("listA"=rownames(mtcars)[1:16], "listB"=rownames(mtcars)[17:32]),
    selected = rownames(mtcars)
  )
)
server <- function(input, output, session) {}
shinyApp(ui = ui, server = server)
0

There are 0 answers