title: Edit DT Datatable Server-side in Shiny App
body: <p>Trying to work through an example to edit DT tables as shown <a href="https://yihui.shinyapps.io/DT-edit/" rel="nofollow noreferrer">here</a>. Not sure my code is updating server-side as I'm hoping. I'm computing a mean of a variable just to see if things are being updated. I'm using renderUI as my real world problem is outputting more than just a table.</p>
  <p>Thank you for any suggestions on how to get the table to update server side.</p>
  <pre><code>library(shiny)
  library(DT)
  
  bp &lt;- data.frame(weights = rep(1,5), x = rnorm(5))
  
  shinyApp(
  
    ui = fluidPage(
  
      #DT::dataTableOutput(&quot;x5&quot;),
      uiOutput(&quot;x5&quot;),
      verbatimTextOutput('test')
  
    ),
  
    server = function(input, output, session) {
      bp &lt;- bp
       
      output$x5 &lt;- renderUI({
          tableOut &lt;- DT::datatable(bp, editable = TRUE, filter = list(position = 'bottom'))
      })
  
      # edit a single cell
      proxy = dataTableProxy('x5')
      
      observeEvent(input$x5_cell_edit, { 
        info = input$x5_cell_edit
        bp &lt;- editData(bp, info)
        replaceData(proxy, bp, resetPaging = FALSE)  
      })
      
      output$test &lt;- renderPrint({
          mean(bp$weights)    
      })
  
    }
  )
  </code></pre>