Yang-Tang / shinyjqui

jQuery UI Interactions and Effects for Shiny
https://yang-tang.github.io/shinyjqui/
Other
273 stars 32 forks source link

From Dest back to Source? #54

Closed MayaGans closed 4 years ago

MayaGans commented 5 years ago

Firstly thank you for this wonderful widget it's awesome!!

I'm making a ShinyApp where I'd like to use two sources for a single dest, but I want to add limitations to the dest that it only accepts one input from ROWS and one from COLUMNS. Can you point me to where in the JS script I can write this modification?

ui <- fluidPage(
  orderInput('source', 'ROWS', items = c("A", "B", C"),
             as_source = TRUE, connect = 'dest'),
  orderInput('source', 'COLUMNS', items = c("D", "E", F"),
             as_source = TRUE, connect = 'dest'),
  orderInput('dest', 'Dest', items = NULL, placeholder = 'Drag items here...'),
  verbatimTextOutput('order')
)

server <- function(input, output) {
  output$order <- renderPrint({ print(input$dest_order) })
}

shinyApp(ui, server)

Thanks again!!