Problems with JQuery 1.9.0 with TableTools 2.0.2
Problems with JQuery 1.9.0 with TableTools 2.0.2
howardjd
Posts: 3Questions: 0Answers: 0
I am having trouble getting a TableTools example to work in 2.0.2. If I put the bJQueryUI: true line in it causes the buttons for pagination to disappear. If I put in the line "sDom": 'T<"clear">lfrtip', then some error occurs and the table does not render as if it were a JQuery table. In either case the buttons do not appear. I have tried a number of iterations and none of the work correctly. Can anyone show me why my example does not work? Thanks.
[code]
My Table Test
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/media/css/demo_page.css";
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/media/css/demo_table.css";
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/TableTools-2.0.2/media/css/TableTools.css";
div.dataTables_wrapper { font-size: 13px; }
table.display thead th, table.display td { font-size: 13px; }
$(document).ready(function() {
$('#mytable').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[3, 5, 10, -1], [3, 5, 10, "All"]],
"oTableTools": {
"aButtons": ["copy",
"csv",
"xls",
"pdf",
{ "sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "pdf" ]
}
],
}
} );
} );
First Name
Last Name
Gender
City
State
Zip Code
John
Howard
Male
Delray Beach
FL
33446
Arnold
Thompson
Male
Boynton Beach
FL
33446
Carol
Howard
Female
Brick
NJ
07823
Stuart
Hoffer
Male
Rocky Mount
NC
27802
Beth
Wilson
Female
New York
NY
10005
Jim
Thompson
Male
Watertown
NY
13602
Bill
Smith
Male
Jackson Hole
WY
83025
Laura
Gunderson
Female
Los Angeles
CA
93510
Terri
Noland
Female
Boca Raton
FL
33487
Val
Wessels
Female
Lake Worth
FL
33454
Dick
Wessels
Male
Debuque
IA
52001
Leigh
Fogus
Female
Myrtle Beach
SC
29575
Rich
Fogus
Male
Myrtle Beach
SC
29575
Dan
Brennan
Male
Palm Beach Gardens
FL
33410
[/code]
[/code]
[code]
My Table Test
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/media/css/demo_page.css";
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/media/css/demo_table.css";
@import "file:///C:/Users/JDH/Desktop/DataTables-1.9.0/TableTools-2.0.2/media/css/TableTools.css";
div.dataTables_wrapper { font-size: 13px; }
table.display thead th, table.display td { font-size: 13px; }
$(document).ready(function() {
$('#mytable').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[3, 5, 10, -1], [3, 5, 10, "All"]],
"oTableTools": {
"aButtons": ["copy",
"csv",
"xls",
"pdf",
{ "sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "pdf" ]
}
],
}
} );
} );
First Name
Last Name
Gender
City
State
Zip Code
John
Howard
Male
Delray Beach
FL
33446
Arnold
Thompson
Male
Boynton Beach
FL
33446
Carol
Howard
Female
Brick
NJ
07823
Stuart
Hoffer
Male
Rocky Mount
NC
27802
Beth
Wilson
Female
New York
NY
10005
Jim
Thompson
Male
Watertown
NY
13602
Bill
Smith
Male
Jackson Hole
WY
83025
Laura
Gunderson
Female
Los Angeles
CA
93510
Terri
Noland
Female
Boca Raton
FL
33487
Val
Wessels
Female
Lake Worth
FL
33454
Dick
Wessels
Male
Debuque
IA
52001
Leigh
Fogus
Female
Myrtle Beach
SC
29575
Rich
Fogus
Male
Myrtle Beach
SC
29575
Dan
Brennan
Male
Palm Beach Gardens
FL
33410
[/code]
[/code]
This discussion has been closed.
Replies
Btw - the trailing comma on line 41 above isn't going to help.
Allan
However, using DataTables 1.9.0 and TableTools-2.0.2 I see the same problem reported by others. That is, all of the select_all, select_none, print, copy, csv, xls and pdf buttons all show up. Clinging on the print button works by popping up a message saying to use the browser print facility. The copy, csv, xls and pdf buttons display the hand with the finger when placed over the button. When copy is clicked it actually copies the word blank to the clipboard but I get no message saying data has been copied as others have stated. I tried selecting all with the select_all button and with the mouse. Same result. The others (csv, xls and pdf do nothing at all).
Thanks for any input you can provide.
Thanks.
I'm sorry to bother you again with this issue... I tried to reproduce your code, adapted a bit, but still could not manage to make it work. Cleared cache and everything...
Below is my code:
My Table Test
@import "TableTools-2.0.2/media/css/TableTools.css";
@import "DataTables-1.9.0/media/css/demo_page.css";
@import "DataTables-1.9.0/media/css/demo_table.css";
@import "css/redmond/jquery-ui-1.8.18.custom.css";
*{
font-family: Segoe UI, Arial;
font-size:small;
}
$(document).ready(function(){
$('#mytable').dataTable({
"sDom": 'T<"clear">lfrtip',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aLengthMenu": [[3, 5, 10, -1], [3, 5, 10, "All"]],
"oTableTools": {
"sSwfPath": "TableTools-2.0.2/media/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
"copy", "csv", "xls", "pdf",
{
"sExtends": "collection",
"sButtonText": "Save",
"aButtons": [ "csv", "xls", "pdf" ]
}
]
}
});
});
First Name
Last Name
Gender
City
State
Zip Code
John
Howard
Male
Delray Beach
FL
33446
Dan
Brennan
Male
Palm Beach Gardens
FL
33410
Allan
DataTables works as expected. Problem appeared when I tried to use Table Tools - I can't make the export buttons to show.
Initially I tried to use jquery Ui theming: "sDom": '<"H"Tlf>t<"F"ip>', - without result, then I thought I would be happy even without UI theme ( "sDom": 'T<"clear">lfrtip', ) but I still can't see any result. The simple presence of the "T" in that declaration actually destroys the table (in lack of a better wording)
The test page would be the actual code above (don't have a link as I test it on my company intranet)
Allan
Thank you!