How to toggle the export (print, excel, etc) of a column.
How to toggle the export (print, excel, etc) of a column.
Glyndwr
Posts: 128Questions: 35Answers: 1
I am toggling the visibility of a column and would also like to toggle the export (print, excel, etc) as well (i.e. only export when visible). Can someone please show me how to do this?
// Get the column API object
var column = patrolUpdateTable.column(4);
// Toggle the visibility
column.visible( ! column.visible() );
I can not simply print if visible as there is a column containing images that is visible and I am not exporting.
{extend: 'copy',
exportOptions: {
columns: [ 2, 3 ]
}
},
Kind regards,
Glyn
This discussion has been closed.
Answers
See if this example helps:
https://datatables.net/extensions/buttons/examples/print/columns.html
Kevin
Hi Kevin,
Thanks for your help. I have seen this what I need is something like:
I can not find the correct command to toggle the export (print, excel, etc).
Kind regards,
Glyn