dreamRs / datamods

Shiny modules to import and manipulate data into an application or addin
https://dreamrs.github.io/datamods/
GNU General Public License v3.0
138 stars 35 forks source link

Select All Checkbox not rendering in select_group_ui #99

Closed yaswant-krishna closed 6 months ago

yaswant-krishna commented 6 months ago

Issue Description

Hello,

When select_group_ui is used with multiple = TRUE, the checkbox to select all is not being displayed.

library(shiny)
library(shinydashboard)
library(datamods)
library(shinyWidgets)

ui <- shinydashboard::dashboardPage(
  shinydashboard::dashboardHeader(),
  shinydashboard::dashboardSidebar(
    shinyWidgets::dropMenu(
      shiny::actionButton(
        inputId = "iqvia", 
        label = "IQVIA", 
        style = "color: #000000; background-color: #d1e8f0; border-color: #2e6da4; width:200px;"
      ),
      select_group_ui(
        id = "my-filters",
        inline = FALSE,
        params = list(
          list(inputId = "Manufacturer", label = "Manufacturer:"),
          list(inputId = "Type", label = "Type:"),
          list(inputId = "AirBags", label = "AirBags:"),
          list(inputId = "DriveTrain", label = "DriveTrain:")
        ), 
        vs_args = list(
          multiple = TRUE, 
          search = TRUE, 
          selected = TRUE, 
          noOfDisplayValues = 1, 
          dropboxWidth = "200%", 
          position = "bottom"
        )
      )
    )
  ),
  shinydashboard::dashboardBody()
)

server <- function(input, output) {
  res_mod <- select_group_server(
    id = "my-filters",
    data = reactive(MASS::Cars93),
    vars = reactive(c("Manufacturer", "Type", "AirBags", "DriveTrain"))
  )
}

shiny::shinyApp(ui, server)

Output

image

Expected Output

image

Regards, Yaswant Krishna.

pvictor commented 6 months ago

Hello, You have to use disableSelectAll = FALSE in vs_args list of options.

Victor

yaswant-krishna commented 6 months ago

I have used disableSelectAll = FALSE in vs_args list of options but still I am not able to see the checkbox.

Output after using disableSelectAll = FALSE

image

Regards, Yaswant.

pvictor commented 6 months ago

Try the dev version by reinstalling from GitHub.

Victor

yaswant-krishna commented 6 months ago

Tried the dev version, it worked. Thanks!

Yaswant Krishna.