Datatables export only visible columns

1,949 views
Skip to first unread message

g inberg

unread,
Apr 27, 2017, 4:29:54 AM4/27/17
to Shiny - Web Framework for R
Hi all,

in a datatable I am using the option (button) to hide certain columns in the data, since there are a lot of columns.

Now I am adding an excel export option and I would like to export only the visible columns, but it is exporting all columns.

In the javascript version of datatables it is working see https://datatables.net/extensions/buttons/examples/html5/columns.html but I don't know how to do this in shiny.

Any ideas?

best,
Ger

g inberg

unread,
Apr 27, 2017, 5:03:31 AM4/27/17
to Shiny - Web Framework for R
I found it myself. For reference I used syntax like

buttons = list(list(extend = 'excel', exportOptions = list(columns = ':visible')), list(extend = 'colvis', text='Show/Hide Columns', collectionLayout='fixed four-column'))
Reply all
Reply to author
Forward
0 new messages