Dynamic Paths on TableTools

Dynamic Paths on TableTools

bpeterson76bpeterson76 Posts: 11Questions: 0Answers: 0
edited September 2010 in General
I'm working on an older Symfony Framework-based app that uses virtual directories, and it's been wreaking havoc with Table Tools. Let me emphasize, I'm not using this framework by choice! Here's my challenge.

The page running DataTables and attempting to run Table Tools has the URL:
http://dev.site.net/web/prospect/list/clientGuid/xxxx

The above page is <> located at /apps/company/modules/view/templates/listSuccess.php. ClientGuid isn't actually a folder, but a variable that the framework interprets and reads in.

I've placed my ZeroClipboard.swf file in the physical location /web/swf/ZeroClipboard.swf. You can physically access it by typing in the url in the browser...but despite trying nearly every possible combination to include it, no dice. When I attempt to alert the document.location.pathname in TableTools.min.js as called by the above virtual URL, it tells me the path to file is /web/prospect/list/clientGuid/xxxx. I've even attempted to reference back to the .swf relative to that long (virtual) URL with no success.

Here's a snippet of my DataTables code:

[code]
TableToolsInit.sSwfPath = "../swf/ZeroClipboard.swf";

/* Builds Datatable from ajaxAction.php. fnServerData pushes for values asynchronously and deposits as a POST */
oTable = jQuery('#prospectList').dataTable( {
"aaSorting": [[ 2, "asc" ]],
"bProcessing": true,
"sDom": 'T<"clear"><"H"lfr>t<"F"ip>',
"oLanguage": {
"sProcessing": "Loading <?php echo addslashes(image_tag('icons/loader.gif')); ?>"
},
"bServerSide": true,
"sAjaxSource": "<?php echo url_for('prospect/ajax') ?>",
"bJQueryUI": true,
[/code]

Despite having good success on other installations that weren't using this convoluted web structure, I'm confuddled with this one! Anyone have any solutions to this challenge?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Is Symfony doing a URL rewrite? If you enter http://yourdomain.com/web/swf/ZeroClipboard.swf into the browser does it load the swf? If so, then the path should simply be TableToolsInit.sSwfPath = "/web/swf/ZeroClipboard.swf";

    Allan
  • bpeterson76bpeterson76 Posts: 11Questions: 0Answers: 0
    Allan,

    Indeed it is a URL rewrite, and unfortunately that doesn't seem to work--it just blows up the tablesorter altogether. I'm wondering if perhaps something else could be causing the error "Uncaught ReferenceError: ZeroClipboard is not defined"

    I've double checked that the file is available on the server at the address you provided. The error is occuring inside tabletools.js file, so that is being loaded. Is there a gotcha on the sDom positioning?

    Thanks in advance. I love your script!

    Ben
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    It sounds like you might not be including the ZeroClipboard.js file actually. That is also needed as it is the interface to the SWF file, and without it, the SWF won't work at all. How do you include the ZeroClipboard.js file?

    Allan
  • bpeterson76bpeterson76 Posts: 11Questions: 0Answers: 0
    Allan, you hit it on the head...I missed it because it wasn't in the js folder! Thanks again for all your help. It's working great.
This discussion has been closed.