TableTools new initialisation with individual column searching
TableTools new initialisation with individual column searching
bunny183
Posts: 6Questions: 2Answers: 0
Hello. The closest I could find is this one http://datatables.net/forums/discussion/2883/combine-tabletool-and-individual-column-filtering but I'm using the new initialisation and I have no idea how or where to put the codes.
Here's my js code
<script type="text/javascript" language="javascript">
var dataTableOptions = {
//Auto sort column
"order": [[1,'asc']],
//Disable sorting with class no-sort
"columnDefs": [
{ targets: 'no-sort', orderable: false }
],
"bLengthChange": false,
"bFilter": true,
"bInfo": false,
"bAutoWidth": false
};
var tableToolsOptions = {
"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
"aButtons": [ {
"sExtends": "copy",
"sButtonText": "Copy"
},
{
"sExtends": "collection",
"sButtonText": "Save as...",
"aButtons": [ {
"sExtends": "xls",
"oSelectorOpts": {
page: 'current'
},
//Columns to export as data, exluded Action column
"mColumns": "visible"
}, {
"sExtends": "pdf",
"sButtonText": "PDF",
//Columns to export as data, exluded Action column
"mColumns": "visible"
}
]
}
]
};
var table = $('#report').dataTable( dataTableOptions );
var tt = new $.fn.dataTable.TableTools( table, tableToolsOptions );
$( tt.fnContainer() ).insertBefore('div.dataTables_wrapper');
</script>
This discussion has been closed.