[solved] tabletools: clipboard ok but not export (csv or xls)
[solved] tabletools: clipboard ok but not export (csv or xls)
Hi,
I moved the tabletools under a different folder than usual, then added a
[code]TableToolsInit.sSwfPath="/themes/meps/tabletools/swf/ZeroClipboard.swf";[/code]
I got the little icons, it copies properly into the clipboard, however, nothing happen on the csv or xls. No msg, no error message on firebug.
Is there an extra plugin that should be loaded to make it work ? Otherwise, is it possible to run in debug mode the swf to get more information ?
Any suggestion more than welcome...
X+
I moved the tabletools under a different folder than usual, then added a
[code]TableToolsInit.sSwfPath="/themes/meps/tabletools/swf/ZeroClipboard.swf";[/code]
I got the little icons, it copies properly into the clipboard, however, nothing happen on the csv or xls. No msg, no error message on firebug.
Is there an extra plugin that should be loaded to make it work ? Otherwise, is it possible to run in debug mode the swf to get more information ?
Any suggestion more than welcome...
X+
This discussion has been closed.
Replies
Interestingly it sounds like you might be running into a similar problem as Lili: http://datatables.net/forums/comments.php?DiscussionID=659 .
If the clipboard works, then the save to file really should as well. I assume you have Flash 10 plug-in installed? You might be able to put the Flash player into debug (right-click and enable debug I think), but I'm not entirely sure. This isn't something that I've seen myself.
It's possible that the data is doing something funny along the way - can you provide a sample link?
Regards,
Allan
On a related ? note, it crashes chromium.
Not too keen on the idea of putting it live, and I don't have any public dev space. Let me try finding a solution...
X+
Well, after inspecting "TableTools.js", I found the cause of the error. - illegal characters in the title of the page.
For some reason, the swf does not show the "save as" dialog if there are illegal-for-windows characters in the title tag. (tabletools.js uses the title tag as the default filename).
I got it to work after modifying the function fnGetTitle( ) in TableTools.js. This is my mod:
[code]
/*
* Function: fnGetTitle (Mod: Fix for illegal chars in title tag
* Purpose: Get the title of the page (from DOM or user set) for file saving
* Returns:
* Inputs:
*/
function fnGetTitle( )
{
if ( _oSettings.sTitle != "" )
return _oSettings.sTitle;
else
var $page_title = document.getElementsByTagName('title')[0].innerHTML;
var $clean_page_title = $page_title.replace(/<|>|:|"|\/|\\|\||\?|\*|\.\./ig, "");
// Limit Length to be safe .. :)
if( $clean_page_title.length >= 100)
{
$clean_page_title = $clean_page_title.substr(0, 100);
}
return $clean_page_title;
}
[/code]
I hope this helps and do let me know if you found another fix.
Cheers!
John C
X+
Regards,
Allan
John C patch worked for me too.
Thanks !
X+
The source file of the latest package says " * Created: Wed 1 Apr 2009 08:41:58 BST".
Cheers
Allan