Uncaught ReferenceError: ZeroClipboard_TableTools is not defined

Uncaught ReferenceError: ZeroClipboard_TableTools is not defined

bcorpnickbcorpnick Posts: 3Questions: 0Answers: 0
edited April 2013 in General
I am attempting to enable the Export features provided by TableTools plug-in, but am getting the error in my de-bug console "Uncaught ReferenceError: ZeroClipboard_TableTools is not defined "

ZeroClipboard.js is referenced in my code and it is in the proper directory. I have also set an absolute path for the swf file and am able to access it by following the link to the file.

I may not be utilizing the sDom properly with calling both the filter widgets and Tabletools so any help would be greatly appreciated:

Here is my code:

$(document).ready(function () {
var oTable = $('#responsetable').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
       "sDom": '<"clear">WRCT<"clear">lfrtip<"clear">',
"oTableTools": {
"sSwfPath": "http: sites/default/files/Tools/copy_csv_xls_pdf.swf"
},
"aaSorting": [[ 3, "desc" ]],
"bAutoWidth": false,    
"aoColumns": [
{"sWidth": "5%"},
{"sWidth": "40%"},
{"sWidth": "25%"},
{"sWidth": "5%"},
{"sWidth": "5%"},
{"sWidth": "10%"},
{"sWidth": "10%"},
],
"oColumnFilterWidgets": {
"aiExclude": [ 1, 2, 3, 4, 5 ]
},

      
          });

          });

Replies

  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin
    You probably haven't loaded the ZeroClipboard.js file that is in the TableTools media/js directory.

    But we'd need a link to the page to be sure - I'm just guessing: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • bcorpnickbcorpnick Posts: 3Questions: 0Answers: 0
    Hi Allan,

    I apologize for not posting a link, I read the policy, but it is quite difficult to deliver my page or even a sample of it. I am working with Datatables within a Salesforce VisualForce page that requires log-in.

    As mentioned in my post, I can tell you that ZeroClipboard.js is being loaded as it shows up as a resource in Chrome developer tools. Is there anything else you think might be causing this error?

    The error is being thrown in TableTools.js if that is at all helpful.
  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin
    Did you load the ZeroClipboard version that comes with TableTools? https://github.com/DataTables/TableTools/blob/master/media/js/ZeroClipboard.js . That defines the parameter that Chrome is telling you is missing.

    Allan
  • bcorpnickbcorpnick Posts: 3Questions: 0Answers: 0
    Thanks again for the response Allan. I am sure I have the latest ZeroClipboard.js that is provided with the latest version of DataTables. I checked the contents of the file you linked to against the one that I am referencing and they are identical.

    The error is being thrown at line 1290 for the _fnFlashConfig: in TableTools.js

    var that = this;
    var flash = new ZeroClipboard_TableTools.Client();
  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin
    If you are including the file, then I really don't know what is causing the error. I'd need a link to a test case, otherwise I'm just randomly guessing, and in this case, I don't even know where to start :-).

    Allan
This discussion has been closed.