return DTEdit table?

return DTEdit table?

我正在使用 DTEdit 允许用户在我的 Shiny 应用程序中编辑数据table。它运行良好并在 UI 中显示用户的 updates/inserts。但是,我希望能够在更新的 table 上执行功能。有没有办法 return 更新后的 table 到服务器端以及 UI 端?

dtedit处理用户数据编辑的主要方法是使用和定义回调.

但是,dtedit 做了 return 和 reactiveValues。服务器端,'reactiveValues' 中的更改可以在 observeEvent.

中检测到

我有使用 reactiveValues 的 return 列表和在 vignette, based on my modified version of DTedit. Previously my version of DTedit returns a list of 'reactives', rather than a 'reactiveValues', but now returns reactiveValues, just like jryer/DTedit 中使用回调的示例。

使用jbryer/DTedit

server <- function(input, output) {
    
    Grocery_List_Results <- dtedit(
        input, output,
        name = 'Grocery_List',
        thedata = data.frame(
            Buy = c('Tea', 'Biscuits', 'Apples'),
            Quantity = c(7, 2, 5),
            stringsAsFactors = FALSE
        )
    )
    
    observeEvent(Grocery_List_Results$thedata, {
        message(Grocery_List_Results$thedata)
    })
    
}

ui <- fluidPage(
    h3('Grocery List'),
    uiOutput('Grocery_List')
)

shinyApp(ui = ui, server = server)