Reputation: 2213
How do I make the below always display the last page of the table instead of the first page on every reactive update ?
output$myTable <- DT::renderDataTable(datatable(df) %>% formatRound(c(2:5),2))
Note that reversing the order of the table is not what i wanted.
What I want is that when i start the app, it will bring me to the last page of the table always.
Upvotes: 1
Views: 324
Reputation: 169
Use order option to show table as "reverse" ordered.
https://rstudio.github.io/DT/options.html
I'm not sure difference about reverse order and page to last.
but page to last can be achieved by using callback
.
refer these
Here's minimal reproducible example.
library(DT)
datatable(
data.frame(a = 1:50, b = 1:50 * 2),
callback = JS(
'table.page("last").draw(false);'
)
)
Regards.
Upvotes: 2