The DT documentation displays the possibility of creating editable rows, columns, and cells. When I use editable cells, everything works perfectly. I easily observe changes and could use them for my purposes. The problem is that I can't observe the changes in edited rows or columns. The question is how to find out the edited row number, column, and new value when using editable rows/columns? A simple example from DT (doesn`t work) from it is shown below. P.S. My DT version is 0.19, maybe its important
library(shiny)
library(DT)
dt_output = function(title, id) {
fluidRow(column(
12, h1(paste0('Table ', sub('.*?([0-9]+)$', '\\1', id), ': ', title)),
hr(), DTOutput(id)
))
}
render_dt = function(data, editable = 'cell', server = TRUE, ...) {
renderDT(data, selection = 'none', server = server, editable = editable, ...)
}
shinyApp(
ui = fluidPage(
title = 'Double-click to edit table cells',
dt_output('server-side processing (editable = "row")', 'x6')
),
server = function(input, output, session) {
d6 = iris
d6$Date = Sys.time() + seq_len(nrow(d6))
options(DT.options = list(pageLength = 5))
# server-side processing
output$x6 = render_dt(d6, 'row')
# edit a row
observeEvent(input$x6_cell_edit, {
print("ping")
d6 <<- editData(d6, input$x6_cell_edit, 'x6')
})
}
)
