Skip to content

Commit

Permalink
Merge pull request #36 from CRI-iAtlas/add_select_all
Browse files Browse the repository at this point in the history
Add select all
  • Loading branch information
heimannch authored Dec 17, 2024
2 parents 92af72a + b951562 commit c6a8389
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions R/elements_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ group_filter_element_server <- function(
inline = T
)
})

shiny::observeEvent(input$selectAll, {
if(isFALSE(input$selectAll)){
shiny::updateCheckboxGroupInput(
session,
"group_choices",
choices = group_choices(),
selected = NULL,
inline = T
)
}else{
shiny::updateCheckboxGroupInput(
session,
"group_choices",
choices = group_choices(),
selected = group_choices(),
inline = T
)
}
})

update_reactive <- shiny::reactive({
shiny::req(input$parent_group_choice, input$group_choices)
Expand Down
3 changes: 2 additions & 1 deletion R/elements_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ group_filter_element_ui <- function(id){
ns <- shiny::NS(id)
shiny::tagList(
shiny::uiOutput(ns("select_ui")),
shiny::uiOutput(ns("checkbox_ui"))
shiny::uiOutput(ns("checkbox_ui")),
shiny::checkboxInput(ns('selectAll'), 'Select/Deselect All')
)
}

Expand Down

0 comments on commit c6a8389

Please sign in to comment.