2
I would like to include the event "Restoring column visibility (https://datatables.net/extensions/buttons/examples/column_visibility/restore.html), the code would be the one below:
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{
extend: 'colvis',
postfixButtons: [ 'colvisRestore' ]
}
],
columnDefs: [
{
targets: -1,
visible: false
}
]
} );
In my code in R, could someone tell me how?
output$dtDisp4 <- renderDataTable({
datatable(baseFullGI, extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = list('excel','colvis'),
searchHighlight = TRUE,
columnDefs = list(list(className = 'dt-center', targets = 0:11)),
scrollX = TRUE,
pageLength = 50
), filter = 'top',
class = 'cell-border stripe',
rownames = FALSE)
})
It is not clear what your problem is. What you would like to happen and doesn’t happen?
– Tomás Barcellos
Tomás, I would like to include the event "Restoring the visibility of the column".
– Vitor Quix
https://datatables.net/extensions/buttons/examples/column_visibility/restore.html
– Vitor Quix
For me already appears with your code. Including without including the JS
– Tomás Barcellos
The problem happens if you carry the
shiny
after theDT
. Because he writes about the functionsdataTableOutput()
andrenderDataTable()
. Ask the question with a reproducible example helping.– Tomás Barcellos