In Shiny, you have to use multiple selectInput. However, you can install ShinySky by ZJ ( https://github.com/AnalytixWare/ShinySky ) and use its select2 binding, which allows you to sort. Alternatively, you can change the sortable binding at https://github.com/mostly-harmless/sortable .
Edit: I do not know about cookies. I am using sortable in a larger application . There I have an action button to save the order selected by the user. See Data> Transform> Reorder. In the application, data is stored in activeiveValue. To preserve the data order, I use values[[input$datasets]] <- values[[input$datasets]][,input$tr_reorder_cols] , where input$datasets is the active dataset, input$tr_reorder_cols is the user-selected ordering order , and values is a react valid containing data.
The source of the application is Github: https://github.com/mostly-harmless/radiant
Alternatively, you can also save the order of the variables in the reactiveValue file. See the Shiny documentation for more details.
Edit:
In global.R, define the reactive valid:
savedOrder <- reactiveValues()
When the user reorders (assuming you have a user ID available as a variable in R):
if(!is.null(input$sortable)) { savedOrder[[userid]] <- input$sortable }
In addition, you can pass the id value of returnOrder in case of an update:
if(!is.null(savedOrder[[userid]])) { returnOrder("sortable",savedOrder[[userid]]) } else { returnOrder("sortable",colnames(dat)) }
source share