You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
667 B

datatableUI<- function(id){
ns<-NS(id)
DT::dataTableOutput(ns("dtable"))
}
datatableServer<-function(id, dat){
moduleServer(
id,
function(input,output,session){
output$dtable<- renderDataTable({
validate(need(nrow(dat())>0, "No data"))
datatable(
dat(),
extensions = "Buttons",
options = list(
paging = TRUE,
scrollX = TRUE,
searching = TRUE,
ordering = TRUE,
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf'),
pageLength = 10,
lengthMenu = c(3, 5, 10)
)
)
})
}
)
}