Reputation: 119
Got Datatable to work. Now trying to apply the extra Tabletools (so i can export table to csv).
I can see the export to csv. Am i missing something? I have applied(as suggested)
$(document).ready( function () {
$('#example').dataTable( {
"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"oTableTools": {
"aButtons": [
"copy",
"print",
{
"sExtends": "collection",
"sButtonText": 'Save <span class="caret" />',
"aButtons": [ "csv", "xls", "pdf" ]
}
]
}
} );
} );
I am using the 'jquery-datatables-rails' gem, which it says it supports table tools.
Thank you
Upvotes: 1
Views: 4139
Reputation: 85538
I guess your problem is that you miss the flash-object.
If it is 1.91. Add this to your dataTable{(
code (you must realize that the path depends on your setup, so this is just an example)
sSwfPath: "DataTables-1.9.1/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
Upvotes: 2