Skip to content

Instantly share code, notes, and snippets.

@thisisnic
Created October 8, 2019 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thisisnic/29bc2f7e76879d42cfee450c46b715a5 to your computer and use it in GitHub Desktop.
Save thisisnic/29bc2f7e76879d42cfee450c46b715a5 to your computer and use it in GitHub Desktop.
orderInput stuff
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