I am trying to export a datatable to a excel, pdf and just to copy it. But i just want to export the selected columns from colvis. When i am exporting the table, it always shows me the full datatable. Where is my mistake?
Thx
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#tbl').DataTable( {
dom: 'lBfrtip',
language: {
searchBuilder: {
button: 'Filter',
}
},
buttons:[
'searchBuilder',
{
extend: 'colvis',
collectionLayout: 'fixed columns',
collectionTitle: 'Spalten Auswahl'
},
{
extend: 'copy',
text: 'Copy',
exportOptions: {
modifier: {
columns: ':visible'
}
}
}, {
extend: 'excel',
text: 'Excel',
exportOptions: {
modifier: {
columns: ':visible'
}
}
}, 'pdf'
],
colReorder: true
//scrollX: true,
});
});
</script>