简体   繁体   English

Shiny - 下载 DT 表而不下载操作按钮

[英]Shiny - Downloading DT table without downloading action buttons

I am having trouble with the download/copy/print etc buttons in Shiny and can't get any of the suggested fixes to work.我在使用 Shiny 中的下载/复制/打印等按钮时遇到问题,并且无法获得任何建议的修复程序。 I have a DT table in Shiny with buttons to download as CSV etc. It is a two-column table.我在 Shiny 中有一个 DT 表,带有下载为 CSV 等的按钮。它是一个两列表。

There is also a third column with a 'clipboard' button that allows the user to copy the selected row.还有一个带有“剪贴板”按钮的第三列,允许用户复制选定的行。 I am trying to exclude this third column when downloading/printing etc. Please see below the DT:我试图在下载/打印等时排除第三列。请参见下面的 DT:

DT

The code I have to exclude specific columns from export works in general, but doesn't exclude the third column with the action button.我必须从导出中排除特定列的代码通常有效,但不排除带有操作按钮的第三列。 The code to only include columns 1 & 2 in the export is in Section 3 & Highlighted below:仅在导出中包含第 1 列和第 2 列的代码在第 3 节中,并在下面突出显示:

以下

Sections 1,2 & 4 have codes pertaining to the "clipboard action button".第 1,2 和 4 节有与“剪贴板操作按钮”相关的代码。

I've searched a ton online and looked through the different reference docs but can't seem to find a way to exclude column 3 when exporting.我在网上搜索了大量内容并查看了不同的参考文档,但似乎找不到在导出时排除第 3 列的方法。

Has anyone come across this before?有没有人遇到过这个?

Try this:尝试这个:

buttons = list(
  list(extend = "copy", exportOptions = list(columns = c(0,1)), 
  list(extend = "excel", exportOptions = list(columns = c(0,1)),
  ......
) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM