1

Similar to drop-down checkbox input in shiny I was looking for the option to create a checkboxInput() with two clickable columns such that that if the user needs to group by "X" then "X" is clicked if it wasn't marked as selected. Example:

enter image description here

While I could do this:

checkboxInput("select", "Selected variables", c("A", "B", "C"))

checkboxInput("group", "Grouping variables", c("A", "B", "C"))

I would prefer this:

checkboxInputDouble("vars", "Variables", 
 select = c("A", "B", "C"), 
 group = c("A", "B", "C"), 
 select_2 = c("A", "B")
 group_2 = c("B")
)
pachadotdev
  • 3,345
  • 6
  • 33
  • 60
  • A simpler idea might be to use `actionButton` to pop up a `modalDialog` and have your checkbox UI there. Just a thought... – Shree Oct 23 '18 at 22:18
  • 1
    Not completely the layout you're searching for, but you might have a look at the package shinyWidgets and its button-checkboxes. You may use two of these checkboxes consecutively. It may not look the way you wished, but it's at least a better solution than using two normal checkbox-inputs this way. See: https://github.com/dreamRs/shinyWidgets. – alex_555 Oct 24 '18 at 06:43
  • I would also recommend `shinyWidgets` or you create a [custom input binding](https://shiny.rstudio.com/articles/js-custom-input.html) for it. – SeGa Oct 24 '18 at 19:32

0 Answers0