editModal: Create Add Modal: server function

Description Usage Arguments

View source: R/addEditModules.R

Description

This function and addModalUI are used in conjunction to create the UI and server elements necessary to control the modal

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
editModal(
  input,
  output,
  session,
  inputData,
  reactiveData,
  checkDuplicate,
  db,
  dbTable,
  modalUI,
  staticChoices,
  dtRow,
  ...
)

Arguments

input

These parameters are handled by callModule and can be ignored.

output

These parameters are handled by callModule and can be ignored.

session

These parameters are handled by callModule and can be ignored.

inputData

a data.frame containing columns ids, labels, type, choicesTable, choicesValues, choicesLabels which correspond to

ids

The field names in the database. These ids will also be used as the inputId for shiny inputs.

labels

These are character values which will be used as the label for shiny inputs and be displayed above the input in the UI.

type

The type of shiny input to be used.

choicesTable, choicesValues, choicesLabels

Only used if the desired input has predefined choices (selectInput/selectizeInput). If neither of these inputs are used, then the values should be NA. If one of these inputs is used then:

choicesTable

Is the table in the database where the choices for the given input are.

choicesValues

Is the column in the table which stores the numeric identifier for the choice

choicesLabels

Is the column in the table which stores the character name for the choices

reactiveData

Reactive which stores all of the tables from the database as seperate data.frames

checkDuplicate

character vector specifing which fields to check for possible duplication. Default value is null, and no fields are checked for duplicates

db

a DBIConnection object, as returned by dbConnect. In other words, the object the database connection is saved to.

dbTable

The database table the new data will be added to.

modalUI

Function that creates the modal UI.

staticChoices

list where choices for static selectize inputs are defined.

dtRow

Reactive which stores the row selected in the datatable

...

Additional parameters to mass to modalUI function


JamesCuster/CARTMod documentation built on March 8, 2020, 5:57 a.m.