Problems with JQuery 1.9.0 with TableTools 2.0.2

Problems with JQuery 1.9.0 with TableTools 2.0.2

howardjdhowardjd Posts: 3Questions: 0Answers: 0
edited March 2012 in TableTools
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]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have a look at the firebug or inspector console - it sounds like you are getting a Javascript error. What is that error?

    Btw - the trailing comma on line 41 above isn't going to help.

    Allan
  • howardjdhowardjd Posts: 3Questions: 0Answers: 0
    Thanks Allan. I was having some kind of a cache problem. After clearing the cache and removing the comma most things worked.

    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.
  • howardjdhowardjd Posts: 3Questions: 0Answers: 0
    Ignore the comment above. I finally came across the information that the file cannot be viewed in a browser using file:/// But must be viewed using a web server. Once I did that then everything works as suggested in the documentation.

    Thanks.
  • ZoneZone Posts: 4Questions: 0Answers: 0
    Hello,
    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
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    @Zone - what aspect of it isn't working? TableTools, DataTables, something else, everything? Can you please link us to your test page?

    Allan
  • ZoneZone Posts: 4Questions: 0Answers: 0
    I'm sorry, I'm rather new to technical forums (to jquery also and this could be the problem :) )
    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)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have a look at the Webkit Inspector console - does it have any errors on it?

    Allan
  • ZoneZone Posts: 4Questions: 0Answers: 0
    All right - fire bug say "ZeroClipboard is not defined". Ill have a look on docs.
    Thank you!
This discussion has been closed.