bSelectedOnly not exporting selected rows
bSelectedOnly not exporting selected rows
I'm a new user to DataTables and TableTools and currently testing them to see if they will work effectively for a client. I have had no trouble until wanting to export only rows that are selected. I've read a number of posts in forums where the below code should work. My test table has 29,000 rows of data and no matter how many I select, I get the first ten rows of data in my CSV export. I am using the following versions of DataTables and TableTools: //cdn.datatables.net/1.10.0/js/jquery.dataTables.js &
//cdn.datatables.net/tabletools/2.2.2/js/dataTables.tableTools.min.js. Below is the code:
var table = $('#example').dataTable( {
"processing": true,
"serverSide": true,
"searching" : true,
"ajax": "server_processing.php",
"order": [[ 2, "asc" ]],
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "../extensions/TableTools/swf/copy_csv_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [
{
"sExtends": "csv",
"bSelectedOnly": true,
"bFooter": false
}
]
}
} );
Based on everything I have read, this should work. In advance, thanks for your help.
Answers
Resolved (somewhat). Buried deep in a discussion (http://datatables.net/forums/discussion/837/tabletools-with-serverside-processing) is detail about server side processing and this issue. It appears I have to use the plug-in for Download (Get only) or Download (Get + Post). Hopefully, this will help someone.