Welcome to ClientVPS Mirrors

Switching from DT

Switching from DT

2025-04-24

Let’s say you already use DT::datatable() to display your data, but want to switch to editbl::eDT() to be able to edit it. What should you look out for?

Here is an example covering the above:

library(shiny)
library(DT)
## 
## Attaching package: 'DT'
## The following objects are masked from 'package:shiny':
## 
##     dataTableOutput, renderDataTable
library(editbl)
ui <- fluidPage(DTOutput("DT"))
server <- function(input, output, session){
  output$DT <- renderDataTable({
    datatable(mtcars)  %>%
     formatRound('disp', 1)
  })  
  observe({
      print(input[["DT_cell_clicked"]])
   })
}
shinyApp(ui, server)
Shiny applications not supported in static R Markdown documents

Reworked into eDT():

ui <- fluidPage(eDTOutput("DT"))
server <- function(input, output, session){
  editbl::eDT(
    id = "DT",
    data = mtcars,
    format = function(x){formatRound(x,'disp', 1)})
   
   observe({
      print(input[["DT-DT_cell_clicked"]])
   })
}
shinyApp(ui, server)
Shiny applications not supported in static R Markdown documents

Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.

This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.