Can't get the [CSV, Save, PDF] etc. buttons to display when theming with twitter bootstrap
Can't get the [CSV, Save, PDF] etc. buttons to display when theming with twitter bootstrap
devcoder
Posts: 3Questions: 0Answers: 0
Have this in my javascript tabeltools initialization
[code]
$(document).ready(function() {
$('#countstable').dataTable( {
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"aaSorting":[[0, "desc"]],
"iDisplayLength": 10,
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"print",
{
"sExtends": "collection",
"sButtonText": 'Save ',
"aButtons": [ "csv", "xls", "pdf" ]
}
]
}
} );
} );
[/code]
I have verified that the path to swf file is correct because it worked with jQuery theme. I got the buttons to display then, but since I switched to bootstrap theme, I can't get the buttons to display.
I followed the example on this page http://datatables.net/release-datatables/extras/TableTools/bootstrap.html and included the necessary datatables.bootstrap.js and datatables.bootstrap.css files. The table looks like it is in the example here http://datatables.net/blog/Twitter_Bootstrap_2.
[code]
$(document).ready(function() {
$('#countstable').dataTable( {
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
},
"aaSorting":[[0, "desc"]],
"iDisplayLength": 10,
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf",
"aButtons": [
"copy",
"print",
{
"sExtends": "collection",
"sButtonText": 'Save ',
"aButtons": [ "csv", "xls", "pdf" ]
}
]
}
} );
} );
[/code]
I have verified that the path to swf file is correct because it worked with jQuery theme. I got the buttons to display then, but since I switched to bootstrap theme, I can't get the buttons to display.
I followed the example on this page http://datatables.net/release-datatables/extras/TableTools/bootstrap.html and included the necessary datatables.bootstrap.js and datatables.bootstrap.css files. The table looks like it is in the example here http://datatables.net/blog/Twitter_Bootstrap_2.
This discussion has been closed.
Replies
Allan
"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
The T in the first span6 class.
Scott
Eagle eyes! Yes you are absolutely correct - the issue is simply not initialising TableTools :-)
Allan