Learn R Programming

editbl (version 1.2.0)

customButton: Generate a custom button for eDT

Description

Generate a custom button for eDT

Usage

customButton(id, label, icon = "", disabled = FALSE)

Value

list to be used in eDT(options = list(buttons = xxx))

Arguments

id

character(1), namespaced id

label

character(1)

icon

shiny::icon

disabled

logical. Whether or not the button should start in a disabled state.

Author

Jasper Schelfhout

Details

Combines elements of shiny::actionButton and datatable options

Examples

Run this code
if(interactive()){

  ui <- eDTOutput("data")
  server <- function(input,output,session){
    b <- customButton('print', label = 'print')
    eDT_result <- eDT(id = "data", mtcars, options = list(buttons = list("save", b)))
    observeEvent(input$print,{
          print(eDT_result$state())
    })
  }
  shinyApp(ui,server)
}

Run the code above in your browser using DataLab