How to get TableTools with fixedcolumns to export only specific rows?

How to get TableTools with fixedcolumns to export only specific rows?

BaatmaanBaatmaan Posts: 2Questions: 0Answers: 0
edited September 2013 in TableTools
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]

Replies

  • fearednerdfearednerd Posts: 44Questions: 0Answers: 0
    I remember asking something like this. I was able to create a button that would select visible rows and then after it is selected you can export to csv, excel, etc. I hope it helps. The forum post is located here:
    http://datatables.net/forums/discussion/10321/fngetdata-of-visible-rows-only#Item_6
  • BaatmaanBaatmaan Posts: 2Questions: 0Answers: 0
    Thanks for the answer. I finally managed to do it.
This discussion has been closed.