TableTools not loading, nor table displaying when attempting to initialise it

TableTools not loading, nor table displaying when attempting to initialise it

ryansnakesryansnakes Posts: 2Questions: 1Answers: 0

Hello. This is the code I'm using to try and initialise TableTools:


<link href="//cdn.datatables.net/tabletools/2.2.2/css/dataTables.tableTools.css" rel="stylesheet">

$(document).ready(function() { $('#dataTables-example').dataTable({ "dom": 'T<"clear">lfrtip', "tableTools": { "sSwfPath": "js/plugins/dataTables/extensions/TableTools/swf/copy_csv_xls_pdf.swf" } "bProcessing": false, "bServerSide": true, "bJQueryUI": false, "sAjaxSource": "server_processing.php", "aoColumns": [ { "sWidth": "12%" }, { "sWidth": "12%" }, { "sWidth": "8%" }, { "sWidth": "9%" }, { "sWidth": "7%" }, { "sWidth": "8%" }, { "sWidth": "7%" }, { "sWidth": "17%" }, { "sWidth": "12%" }, ] }); } );

The SWF path is correct, and when removing the table tools code everything works as expected.
Am I missing something?

All that happens is my table doesn't display any results, just the column names.
When looking at Safari's error console, it just reports:

SyntaxError: Expected token '}'

Thank you for any help.

This question has an accepted answers - jump to answer

Answers

  • rhinorhino Posts: 80Questions: 2Answers: 17
    Answer ✓

    Add a comma after the bracket:

    ".../copy_csv_xls_pdf.swf" }, "

  • ryansnakesryansnakes Posts: 2Questions: 1Answers: 0

    Now I feel very silly. Thanks! Sometimes you can't see the wood for the trees.

This discussion has been closed.