Bi-Directional data binding DT (DataTables) to CSV upon editing
Upon editing data in either the CSV or in-place DataTable ShinyApp, how would I incorporate data update and save bi-directional, whereas the data edit changes would post?
library(flexdashboard) # Flexdashboard to create a frame for the content
library(dplyr) # tidy data manipulation
library(leaflet) # Leaflet for the interactive map
library(DT) # DT for the interactive table
library(crosstalk) # Crosstalk for widget interactivity
library(shiny) # Shiny web app to broaden the capabilities of Crosstalk
# Ion icons and Font Awesome for icons
# user interface just shows the table
ui <-
fluidPage(
title = 'Base List Table',
h1('Base List Using Server-side Processing'),
fluidRow(column(8, div(
#TODO: FIX COLUMNS TO DISPLAY 8
dataTableOutput("dataTable")
))))
# server is where all calculations are done, tables are pre-rendered
server <- function(input, output, session) {
# load CSV file
myCSV <-
read.csv(
'https://docs.google.com/spreadsheets/d/e/2PACX-1vToTirzRAHEuMiBXMOt5eyWVK342PnU2mpjl3nZCaveQdWPoFpXeX-oMhPZDZDhk9hBbOtUWQn0w29H/pub?output=csv'
)
#-----------------------------------------------------------------------------
# render data table
#-----------------------------------------------------------------------------
output$dataTable <- renderDT(myCSV,
# data
class = "display nowrap compact",
# style
filter = "top",
# location of column filters
editable = TRUE)
# cells editable
}
# run the app
shinyApp(ui, server)