Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny DT "rows_selected" and "rows_all" are deprecated?

Tags:

r

dt

shiny

I developed a Shine app which uses "input$TABLE_NAME_rows_all" and "input$TABLE_NAME_rows_selected" intensively. After upgrading DT package this functions does not work. I have checked DT documentation at https://rstudio.github.io/DT/shiny.html and seems that these had been deprecated, whith no clear replace for the "rows_all" option.

First question: is there any solution for this? Second question: (if first fails) can I run an app with a certain DT version and other apps in same server with the latest DT package?

thanks

like image 288
COLO Avatar asked Oct 27 '25 14:10

COLO


1 Answers

From the link that you have provided it doesn't look like those functions have been depreciated. Chapter 2.1.1 refers to input$tableId_rows_selected to get the selected rows. Chapter 2.2 DataTables Information refers to input$tableId_rows_all to get all the rowas after filtering.

But take a look at this blog post about the release of the new version of DT, especially this part:

For tables in the server-side processing mode (the default mode for tables in Shiny), the selected row indices are integers instead of characters (row names) now. This is for consistency with the client-side mode (which returns integer indices). In many cases, it does not make much difference if you index an R object with integers or names, and we hope this will not be a breaking change to your Shiny apps.

The blog post is here

Hope this helps

like image 153
Valter Beaković Avatar answered Oct 30 '25 05:10

Valter Beaković