I'm trying to incorporate something like this: https://infra.clarin.eu/content/libs/DataTables-1.10.6/examples/api/show_hide.html into my R Shiny application.
I'm unfamiliar with how to incorporate the JS into R, but showing/hiding columns doesn't necessarily need to function like this. It could be a drop down (selectInput
) with the column headers where the user could select multiple choices in order to hide those specific columns. Or even check boxes to hide/show them.
Just looking for a way for the user to have control over what columns are hidden in a DT.
My options would look like this: options=list(columnDefs = list(list(visible=FALSE, targets=columns2hide)))
, just need a way to fill columns2hide
.
See: Hide certain columns in a responsive data table using DT package