editDThelpers: editDT Helpers

Description Usage Arguments Function Specific Details

Description

Functions that can be used inside or outside the module to add, modify, or filter and display the dataset that gets passed inside and outside the module.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
editDT_currentData(fullData, modifyPlaceID)

editDT_displayData(fullData, modifyPlaceID)

editDT_deletedData(fullData, modifyPlaceID)

editDT_editedData(fullData, modifyPlaceID)

editDT_prepareNewData(
  newData,
  modifyPlaceID = 0,
  fullData = NULL,
  newRecord = FALSE
)

editDT_rebaseModifyPoint(fullData, modifyPlaceID, indexStart = 0)

Arguments

fullData

A data.frame/tibble previously initialized by a editDT_prepareNewData() call and stored in a reactiveValues() list.

modifyPlaceID

The id for the current place in the modify timeline being tracked using the editDT_modifyID column of fullData. This is an integer value from 0 to infinity (i.e. zero indexed). Default 0 used for initializing a dataset for use in the module.

newData

A data.frame/tibble that holds a new dataset for being initialized for or added into a reactiveValues() object for use in the module.

newRecord

TRUE/FALSE of whether or not the record is new. When initializing data from your main source (i.e., a database or file) the default is FALSE. When adding a new record to an already initialized module dataset, set to TRUE.

indexStart

Whether the index should start at 0 or 1. If the table contains all new data (i.e. all from a form entry in a current session) set the index to 1, else set it to 0 (the default)

Function Specific Details

editDT_currentData
  • Filters out the current data based on your modifyPlaceID. This does not filter out deleted data (see editDT_displayData())

  • For use inside and outside the module.

editDT_displayData
  • Filters out the current data based on your modifyPlaceID and filters out deleted data.

  • This should mimic the data being used to fill the module output DataTable.

  • For use inside and outside the module.

editDT_deletedData
  • Filters out the current data based on your modifyPlaceID and returns only the currently deleted rows.

  • This is used in the module to determine if there are any deleted rows.

  • For use inside and outside the module.

editDT_editedData
  • Filters out the currently displayed data based on your modifyPlaceID and returns only the currently edited rows.

  • This is used in the module to determine if there are any edited rows.

  • For use inside and outside the module.

editDT_prepareNewData
  • Prepares data for input into module by adding the columns: 'editDT_uuid', 'editDT_deleteState', 'editDT_editState', 'editDT_newRecord', 'editDT_rowID', 'editDT_modifyID'. Can be used to initialize a dataset for the module or prepare a new record to be added to an already initialized dataset for the module.

  • For use outside the module.

  • The argument newData and modifyPlaceID are used to initialize the input to the main 'tableFull' reactive value.

  • When initializing a new dataset set the modifyPlaceID to 0.

  • When using the function to prepare a new record for input into the table, all arguments will be used and the newRecord argument should be set to TRUE. The fullData argument is used to input the in already initialized reactive values dataset

editDT_rebaseModifyPoint
  • Determines where you are in the modify timeline.If your modifyPlaceID is not equal to max(fullData[['editDT_modifyID']]) it will rebase the fullData. This involves removing all records that have a editDT_modifyID larger the modifyPlaceID and redefining the editDT_modifyID timeline to rebase to 0.

  • WARNING: This is a destructive action and the module is not equipped to undo this modification.

  • This function is called before every action that required a record to be appended to the fullData. This includes record adds, deletes, and edits.

  • For use inside and outside the module.


MARC-KC/marcRviz documentation built on March 29, 2021, 11:30 p.m.