Reputation: 23
This is my code, I want copy or print all, but it only print current page, thank you!
library(shiny)
library(DT)
ui <- fluidPage(
DT::dataTableOutput("tt")
)
server <- function(input, output, session) {
iris2 = head(iris, 20)
output$tt <- DT::renderDataTable(
iris2,
extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = c('copy', 'print')
)
)
}
shinyApp(ui, server)
Upvotes: 1
Views: 445
Reputation: 84529
The easiest way is to use the option server = FALSE
.
output$tt <- renderDT({
datatable(
iris2,
extensions = 'Buttons',
options = list(
dom = 'Bfrtip',
buttons = c('copy', 'print')
)
)
}, server = FALSE)
Upvotes: 2