Dynamic Paths on TableTools
Dynamic Paths on TableTools
bpeterson76
Posts: 11Questions: 0Answers: 0
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?
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?
This discussion has been closed.
Replies
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
Allan