不赞成使用闪亮的DT“rows_selected”和“rows_all”?

时间:2021-03-02 14:25:39

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.

我开发了一个应用程序Shine,它使用了“输入$TABLE_NAME_rows_all”和“输入$TABLE_NAME_rows_selected”。在升级了DT包之后,这个函数就不起作用了。我已经在https://rstudio.github. io/dt/中检查了DT文档。html并似乎已经弃用了这些选项,而“rows_all”选项没有明确的替代。

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?

第一个问题:有什么解决办法吗?第二个问题:(如果第一次失败)我是否可以运行一个带有特定的DT版本的应用程序和其他应用程序在同一个服务器上使用最新的DT包?

thanks

谢谢

1 个解决方案

#1


2  

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.

从你提供的链接来看,这些功能看起来并没有贬值。第2.1.1章引用输入$tableId_rows_selected来获取所选的行。第2.2章DataTables信息是指输入$tableId_rows_all在过滤后获取所有rois。

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

但是看看这篇关于新版本的DT发布的博文,尤其是这一部分:

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.

对于服务器端处理模式下的表(闪亮状态下的表的默认模式),选择的行索引是整数,而不是字符(行名称)。这是为了与客户端模式(返回整数索引)保持一致。在许多情况下,如果您用整数或名称索引一个R对象,这并没有多大区别,我们希望这不会是对您闪亮的应用程序的重大更改。

The blog post is here

博客就在这里

Hope this helps

希望这有助于

#1


2  

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.

从你提供的链接来看,这些功能看起来并没有贬值。第2.1.1章引用输入$tableId_rows_selected来获取所选的行。第2.2章DataTables信息是指输入$tableId_rows_all在过滤后获取所有rois。

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

但是看看这篇关于新版本的DT发布的博文,尤其是这一部分:

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.

对于服务器端处理模式下的表(闪亮状态下的表的默认模式),选择的行索引是整数,而不是字符(行名称)。这是为了与客户端模式(返回整数索引)保持一致。在许多情况下,如果您用整数或名称索引一个R对象,这并没有多大区别,我们希望这不会是对您闪亮的应用程序的重大更改。

The blog post is here

博客就在这里

Hope this helps

希望这有助于