Multiple TableTools on Multiple tables using alternate initialization not working, lone tables work.
Multiple TableTools on Multiple tables using alternate initialization not working, lone tables work.
callumcarolan
Posts: 8Questions: 0Answers: 0
I have 2 tables on 1 page and a TableTools on each one however the buttons do not work, I have many other single TableTools on many other tables however they're only 1 table, with more than 1 table they do not seem to work, could anyone help find a solution?
This discussion has been closed.
Replies
Allan
I used "fnResizeButtons" as seen here: http://datatables.net/extras/tabletools/api
I'm using jQuery Tabs which I didn't realize was causing the issue.
[code]
$(function(){
oTable = $('.dataTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<""f>t<"F"lp>'
});
var oTableTools = new TableTools( oTable, {
"sSwfPath": "http://crm_darkreport/js/dataTables/swf/copy_cvs_xls_pdf.swf",
"buttons": [
"copy",
"csv",
"xls",
"pdf",
{ "type": "print", "buttonText": "Print me!" }
]
} );
$('.tabletools').before( oTableTools.dom.container );
});
[/code]
and here is my HTML:
[code]
Contacts
Name
Address
City
State
Zip
Title
Email
Phone
<?php echo $contactRows; ?>
Payments
Invoice
Payment Date
Amount
Note
<?php echo $accountRows; ?>
[/code]
Allan
> I used "fnResizeButtons" as seen here: http://datatables.net/extras/tabletools/api
So, is it in a tab? If so, you will likely need to use the resize function when the tab is made visible. You can do that something like this http://datatables.net/release-datatables/examples/api/tabs_and_scrolling.html (although obviously called fnResizeButtons).
Allan
Allan