简体   繁体   中英

(AD) Remove "Select All" action button from pickerInput using shinywidgets

Continuing the discussion mentioned here:

Remove "Select All" action button from pickerInput using shinywidgets

OP had this code and tries to remove one of the select/deselect buttons:

pickerInput(inputId = "country_select_list", label = "Select countries", choices = country_list, multiple = TRUE, options = pickerOptions(actionsBox = TRUE))

The answer was to utilize CSS:

.bs-select-all {
  display: none;
}

Where exactly should this part of the code be put so that the select-all button disappears?

Try this

library(gapminder)

my_css <- "
.bs-select-all {
  display: none;
}
.bs-deselect-all {
  width: 100%;
}
"

df <- gapminder
country_list <- unique(df$country)

ui <- fluidPage(
  tags$head(tags$style(HTML(my_css))),
  pickerInput(
    inputId = "country_list", 
    label = "Select countries", 
    choices = as.character(country_list), 
    multiple = TRUE, 
    options = pickerOptions(actionsBox = TRUE)
   
  )
)

server <- function(input, output) {}

shinyApp(ui, server)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM