How to get TableTools with fixedcolumns to export only specific rows?
How to get TableTools with fixedcolumns to export only specific rows?
Baatmaan
Posts: 2Questions: 0Answers: 0
As the title says it all, I've been trying to export some specific rows from my datatable. My goal would be to only export the visible ones. I understand that during the export, visibility is not checked. I tried to approach it from another perspective and play with classes (all rows have the .DTTT_selected class, and the hidden ones lose it), however, it doesn't seem to work, I still get the whole table in the exported files.
Here are my parameters:
[code] var tab = $('#FixedTable').dataTable({
"sScrollX": "100%",
"sScrollXInner": "1200px",
"bScrollCollapse": true,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bPaginate": false,
"asStripeClasses": [],
"sDom": 'T<"clear">tl',
"oTableTools": {
"sSwfPath": "js/media/swf/copy_csv_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [
{
"sExtends": "xls",
"sFileName": "Reporting.xls",
"sButtonText": "Microsoft Excel",
"bSelectedOnly": "true"
},
{
"sExtends": "xls",
"sButtonText": "Csak adatok",
"sFileName": "Reporting.xls",
"bSelectedOnly": "true",
"fnClick": function ( nButton, oConfig, oFlash ) {
showHideRows('row'); //hides some rows, which get a .removeClass()
this.fnSetText(oFlash, this.fnGetTableData(oConfig));
}
},
{
"sExtends": "pdf",
"sButtonText": "PDF formátum",
"sFileName": "Reporting.pdf",
"sPdfOrientation": "landscape",
"bSelectedOnly": "true"
}
]
}});[/code]
Here are my parameters:
[code] var tab = $('#FixedTable').dataTable({
"sScrollX": "100%",
"sScrollXInner": "1200px",
"bScrollCollapse": true,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bPaginate": false,
"asStripeClasses": [],
"sDom": 'T<"clear">tl',
"oTableTools": {
"sSwfPath": "js/media/swf/copy_csv_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [
{
"sExtends": "xls",
"sFileName": "Reporting.xls",
"sButtonText": "Microsoft Excel",
"bSelectedOnly": "true"
},
{
"sExtends": "xls",
"sButtonText": "Csak adatok",
"sFileName": "Reporting.xls",
"bSelectedOnly": "true",
"fnClick": function ( nButton, oConfig, oFlash ) {
showHideRows('row'); //hides some rows, which get a .removeClass()
this.fnSetText(oFlash, this.fnGetTableData(oConfig));
}
},
{
"sExtends": "pdf",
"sButtonText": "PDF formátum",
"sFileName": "Reporting.pdf",
"sPdfOrientation": "landscape",
"bSelectedOnly": "true"
}
]
}});[/code]
This discussion has been closed.
Replies
http://datatables.net/forums/discussion/10321/fngetdata-of-visible-rows-only#Item_6