I use this gem https://github.com/rweng/jquery-datatables-rails to add datatables to my rails app project.
I have added to application.js:
//=require dataTables/extras/TableTools
and application.css.scss:
*= require dataTables/extras/TableTools
*= require dataTables/extras/TableTools_JUI
I use this gem with twitter bootstrap and all is working fine except OTableTools extra.
This is my datatable code:
$("#admin").dataTable({
"sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"bProcessing" : true,
"sScrollX": "100%",
"bScrollCollapse": true,
"bAutoWidth": false,
"aoColumns" : [{"sType" : "html"}, null, null, null],
"aaSorting" : [[0, 'asc'], [1, 'asc']],
"bServerSide" : true,
"sAjaxSource" : "/admin/admins.json",
"oTableTools": {
"aButtons": [
"copy",
"print",
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "pdf" ]
}
]
}
}).fnSetFilteringDelay();
I have added oTableTools like inside this example http://datatables.net/release-datatables/extras/TableTools/bootstrap.html to works with twitter bootstrap.
I can not see the buttons to export to csv, xls, and pdf format…etc
What am I doing wrong? Where is the problem?
Thank you very much
If you have a slightly different director structure than the default TableTools example you’ll need to set the sSwf path for the swf file that does the saving, i.e.:
But my understanding is that shouldn’t effect the display only the functionality (actual saving and copying).
I am having the exact same problem as you. All my code is processed – I checked with DataTables debugger and it recognizes TableTools is being used in the DataTable.
Let me know if you figure this out!