I have a dataframe with 50k rows and 4 columns - not that big. I'm trying to display it using DT. I used to use the native shiny datatables a few months ago and it was fine, but now with DT it's taking >5 seconds, which is really bad UX.
I'm assuming the whole table is being loaded instead of dynamically loading page by page, and I was hoping maybe using server-side processing would help with that. But I can't figure out how to use serverside processing.
Here is an example app
library(shiny)
df <- data.frame(a = 1:50000, b = 50000:1)
runApp(shinyApp(
ui = fluidPage(
DT::dataTableOutput("table")
),
server = function(input, output, session) {
output$table <- DT::renderDataTable({
DT::datatable(iris)
})
}
))
To combat the slowness, the docs for `datatable` say that I can add a parameter `server = TRUE`. After adding that parameter, I get a message saying I need to specify "ajax" and points me to the website docs
https://rstudio.github.io/DT/server.htmlBut on the website it has a completely different syntax and tells me to use
`DT::renderDataTable(iris, server = FALSE)` without even using the `datatable` function. Running that fails with a message saying that the server param is ignored.
I'm assuming both docs are outdated, which is fine, but I can't figure out how to use the server parameter.
shiny v0.12.0.9002
DT v0.0.41