Buttons export to excel visible columns
Buttons export to excel visible columns
batspy
Posts: 3Questions: 1Answers: 0
Hello,
I am using the following code:
$('#tbl').DataTable( {
"dom": 'Blpfrti',
"tableTools": {
"sRowSelect": "single",
"aButtons": [{
"sExtends": "collection",
"mColumns": "visible",
"oSelectorOpts": { filter: 'applied', order: 'current', page: 'all' },
}],
},
buttons: [
'copy', 'excel', 'csv', 'pdf'
]
} );
I am trying to export to excel the visible rows/columns/filtered data. Everything works fine but it doesn't filter the columns. Whatever I may do it keeps showing all the columns and not only the visible.
Am I doing something wrong?
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
It looks like you are mixing TableTools and Buttons together - I would very strongly encourage you to remove TableTools entirely. This example shows how to do it in Buttons.
Allan