consortUI: Connected Sort UI

View source: R/consortUI.R

consortUIR Documentation

Connected Sort UI

Description

Create a CONnected SORT ui whose items are sortable and transferable between other elements rendered by this method

Usage

consortUI(
  inputId,
  label,
  items = NULL,
  item_class = NULL,
  classes = NULL,
  placeholder = "n/a",
  width = "300px",
  ...
)

Arguments

inputId

Input ID.

label

Element label.

items

Optional, character vector of items.

item_class

Optional, additional class for items in the sortable ui element.

classes

Optional, additional classes for the sortable ui element. Including the "one-to-one" class will create a "monogamous" consort element that will only take one item (see details).

placeholder

Placeholder text.

width

UI element width.

...

Attributes and children passed into the container 'div'.

Details

This is based on the package function shinyjqui::orderInput, but the HTML input builder is simpler and the custom Shiny input bindings are implemented somewhat differently for a more specific purpose. In particular, there is an option to specify a "one-to-one" class, which will be recognized to make the element have the behavior of only taking one droppable item at a time. Items within the "one-to-one" elements are conferred the item class "used", while elements built without the "one-to-one" class confer upon their child items the class "un-used", to help visualize new membership after transfers.


avucoh/DIVE documentation built on Aug. 29, 2023, 6:02 p.m.