Skip to contents

Build Attribute Shortcuts

Usage

attribute_shortcut(colClass, suggestions, ns)

Arguments

colClass

a length-one named vector. names(colClass) is the name of the attribute, and colClass is the type (class) of the attribute.

suggestions

a list of suggestions, output of attribute_suggestion

ns

the module namespace function reference

Value

a list of actionLink objects

The return value is the output of lapply applying actionLink over suggestions

The actionLink has an onclick property that will trigger input$shortcut_trigger (ns(shortcut_trigger)) Its value is of the form [ns]-[attribute]_[value] Basically, applying tail(unlist(strsplit(input$shortcut_trigger, split = "-")), 1) will access attribute_value

Note that for POSIXct attribute, the shortcut_trigger input will not carry the timezone information. Clicking on the corresponding actionLink will only trigger date & time inputs update.

Examples

if (FALSE) { # \dontrun{
attribute_shortcut(colClass = c(name = "character"),
suggestions = list(mango = 25, banana = 12, lemon = 10),
ns = session$ns)
} # }