editData icon indicating copy to clipboard operation
editData copied to clipboard

Customize selection of action buttons

Open hughandersen opened this issue 3 years ago • 1 comments

Good package, thanks. It is possible to remove some of the buttons like Delete All, download as RDS etc? I like the way fields are modified in a pop up window, but all I need to do is edit one record.

hughandersen avatar Jan 24 '22 01:01 hughandersen

@hughandersen You will have to do that through CSS using:

tags$head(tags$style(HTML('
     #edit_measurement_table-deleteAll,
     #edit_measurement_table-downloadRDS {
        display:none;
      }
        ')))

A reproducible code:

library(shiny)
library(editData)

ui <- fluidPage(
  tags$head(tags$style(HTML('
     #table1-deleteAll,
     #table1-downloadRDS {
        display:none;
      }
        '))),
  h2("Data 1"),
  textInput("mydata","Enter data name",value="mtcars"),
  editableDTUI("table1"),
  verbatimTextOutput("test")
)
server <- function(input, output) {
  
  data=reactive({
    myget(input$mydata)
  })
  
  df=callModule(editableDT,"table1",data=reactive(data()))
  
  output$test=renderPrint({
    str(df())
  })
}
shinyApp(ui, server)

kianweelee avatar Jun 23 '22 05:06 kianweelee