Created
October 8, 2019 23:11
-
-
Save thisisnic/29bc2f7e76879d42cfee450c46b715a5 to your computer and use it in GitHub Desktop.
orderInput stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shinyjqui) | |
library(shiny) | |
show_columns <- c('column a','column b','column c','column d','column e','column f','column g','column h','column i','column j','column k','column l','column m','column n','column o','column p') | |
hidden_columns <- c('column q','column r','column s','column t','column u','column v','column w','column x','column y','column z') | |
ui <- fluidPage( | |
column( | |
width = 12, | |
column( | |
width = 2, | |
orderInput( | |
"show_cols", | |
label = "Show", | |
connect = "hide_cols", | |
items = hidden_columns, | |
item_class = "primary", | |
width = "17%" | |
) | |
), | |
column( | |
width = 2, | |
orderInput( | |
"hide_cols", | |
label = "Hide", | |
connect = "show_cols", | |
item_class = "primary", | |
items = show_columns, | |
width = "17%" | |
) | |
) | |
) | |
) | |
server <- function(input, output, session){ | |
observeEvent(eventExpr = { | |
input$show_cols_order | |
input$hide_cols_order | |
}, { | |
print("Showing") | |
print(input$show_cols_order) | |
print("Hiding") | |
print(input$hide_cols_order) | |
}) | |
} | |
shinyApp(ui, server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment