selectInputDT_Server {editbl}R Documentation

Server part to use a datatable as select input

Description

Server part to use a datatable as select input

Usage

selectInputDT_Server(
  id,
  label = "",
  choices,
  selected = NULL,
  multiple = FALSE
)

Arguments

id

character(1) same one as used in selectInputDT_UI

label

character(1)

choices

data.frame

selected

data.frame with rows available in choices.

multiple

logical. Whether or not multiple row selection is allowed

Value

A selection of rows from the data.frame provided under choices.

Author(s)

Jasper Schelfhout

See Also

shiny::selectInput. This function can be more convenient for selecting rows with multiple columns.

Examples

## Only run this example in interactive R sessions
if(interactive()){
  ui <- selectInputDT_UI('id')
  data <- data.frame(id = 1:3, name = letters[1:3])
  server <- function(input,output, session){
    selected = selectInputDT_Server('id', choices = data, selected = data[1,] )
    observe({print(selected())})
  }
  shiny::shinyApp(ui, server)

}

[Package editbl version 1.0.5 Index]