Package DT: Get re-ordered columns names in Shiny

Dear Rstudio Community,

When using the interactive table of DT in Shiny, how to get the re-ordered column names in the server part?
There is a similar post: But it only catches the new order of columns, and the new order is based on the last re-ordered columns rather than original columns. If original columns it is easy to get the answer.

library(shiny); library(DT)
if (interactive()) {
    ui = fluidPage(
      fluidRow(column(12, dataTableOutput('table'))
    server = function(input, output) {
      output$table <- renderDataTable(datatable(iris, extensions=c('ColReorder', 'Scroller'), options=list(pageLength=5, colReorder=TRUE, scroller=TRUE))

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.