Unable to export filtered record from datatatable using table tools
Unable to export filtered record from datatatable using table tools

when i try to export records in pdf /csv it exported whole records not filtered records
here is my code:
can some one help,what i need to do
$(document).ready(function() {
var table = $('#datatable').DataTable( {
sDom: 'T<"clear">lfrtip',
tableTools: {
sSwfPath: "./DataTables-1.10.0/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
"aButtons": [ {
"sExtends": "print",
"sButtonText": "Print",
"oSelectorOpts": { page:'current'}
},
{
"sExtends": "copy",
"bSelectedOnly": "true",
"sButtonText": "Copy",
"oSelectorOpts": { page:'current'}
},
{
"sExtends": "collection",
"bSelectedOnly": "true",
"sButtonText": "Save",
"aButtons": [ "csv","pdf" ],
"oSelectorOpts": { page:'current'}
},
]
}
} );
// Setup - add a text input to each footer cell
$('#datatable thead td').each( function () {
var title = $('#datatable thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// Apply the filter
table.columns().eq( 0 ).each( function ( colIdx ) {
$("#datatable thead input").on( 'keyup change', function () {
table
.search(this.value )
.draw();
} );
} );
This discussion has been closed.