Add download buttons in DT::renderDataTable

后端 未结 1 1186
囚心锁ツ
囚心锁ツ 2021-02-06 06:50

I am trying to add download buttons (\'copy\', \'csv\', \'excel\', \'pdf\') above the table in my R Shiny app, but the renderDataTable seems doesn\'t work when using a datatable

1条回答
  •  滥情空心
    2021-02-06 07:03

    As Stephan said in comment, the way to add buttons is the following:

    output$mytable1  <- DT::renderDataTable(
                            DT::datatable(
                                { plots.dfs()[[1]] },
    
                                extensions = 'Buttons',
    
                                options = list(
                                    paging = TRUE,
                                    searching = TRUE,
                                    fixedColumns = TRUE,
                                    autoWidth = TRUE,
                                    ordering = TRUE,
                                    dom = 'tB',
                                    buttons = c('copy', 'csv', 'excel')
                                ),
    
                                class = "display"
                           ))
    

    0 讨论(0)
提交回复
热议问题