130
rated 0 times
[
135]
[
5]
/ answers: 1 / hits: 17971
/ 8 Years ago, thu, february 11, 2016, 12:00:00
I use the angular-datatable plugin, with export buttons.
Example here: http://l-lin.github.io/angular-datatables/#/withButtons
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
.withDOM('frtip')
.withPaginationType('full_numbers')
// Active Buttons extension
.withButtons([
'columnsToggle',
'colvis',
'copy',
'print',
'excel',
{
text: 'Some button',
key: '1',
action: function (e, dt, node, config) {
alert('Button activated');
}
}
]);
My problem is that When I try to export, the hidden columns shown.
I try to find solution for export just the visible columns, And I find the solution here
https://datatables.net/forums/discussion/3210/tabletools-how-to-hide-columns-when-exporting-copying
$('#list').dataTable({
sDom: 'T<clear>lfrtip',
oTableTools: {
sSwfPath: swf/copy_cvs_xls_pdf.swf, // setting path for swf file. Displays export buttons
aButtons: [{
sExtends: copy,
mColumns: [0, 1, 2, 3, 4, 5] // Export settings for Copy to Clipboard
}, {
sExtends: csv,
mColumns: [0, 1, 2, 3, 4, 5] // Export settings for CSV file
}, {
sExtends: xls,
mColumns: [0, 1, 2, 3, 4, 5] // Export settings for Excel file
}, {
sExtends: pdf,
mColumns: [0, 1, 2, 3, 4, 5], // Export settings for PDF file
sPdfOrientation: landscape
}],
},
- How can I add this option to angular-datatable plugin, For select which column export?
- How can I change the file name for the export file (like excel, pdf)?
More From » jquery