I'm using R's DT in a FlexDashboard. I have the export buttons working, but I'd like to be able to make the exports export only the data that is either selected via rows or when using the DT search function.
I've looked at the DT manual, but it hasn't clarified how I'd go about it.
datatable(
dept_table,
rownames = FALSE,
extensions = "Buttons",
options =
list(
searching = TRUE,
pageLength = 200,
scrollX = TRUE,
scrollY = TRUE,
dom = "BRSpfrti",
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')
)
Thus, if I have a table of 128 rows, and I use the search to select only 10, my export should only have those 10 rows.