0

I have downloaded example

from TableTools. Which is working fine. what i did is i copied the content of the index.html to another file and associated every path. Flash loaded fine but except print button every control is disabled. What could be the issue.

<title>TableTools example</title>
        <style type="text/css" title="currentStyle">
            @import "http://localhost/media/css/demo_page.css";
            @import "http://localhost/media/css/demo_table.css";
            @import "http://localhost/TableTools/media/css/TableTools.css";
        </style>
        <script type="text/javascript" charset="utf-8" src="http://localhost/media/js/jquery.js"></script>
        <script type="text/javascript" charset="utf-8" src="http://localhost/media/js/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8" src="http://localhost/TableTools/media/ZeroClipboard/ZeroClipboard.js"></script>
        <script type="text/javascript" charset="utf-8" src="http://localhost/TableTools/media/js/TableTools.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready( function () {
                $('#example').dataTable( {
                    "sDom": 'T<"clear">lfrtip',
                                        "oTableTools": {
            "sSwfPath": "http://localhost/TableTools/media/swf/ZeroClipboard.swf"
        }

                } );
            } );
        </script>
madth3
  • 7,275
  • 12
  • 50
  • 74
Arasu
  • 2,078
  • 6
  • 40
  • 67

3 Answers3

2

Instead of an sSwfPath value to a local file, try this url:

http://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_x‌​ls_pdf.swf

For some reason this provides functionality for me, but the local file does not.

Stefan
  • 3,850
  • 2
  • 26
  • 39
  • 1
    I know this is old, but when I ran the file on my computer it didn't work, I had to run it on my localhost for the swf to work. Ex. C:\datatables.html didn't work. http://localhost/datatables.html did. Loading the swf from a server rather than local file is what made it work in your case. But maybe your issue was something else. – David Hobs Aug 08 '13 at 04:19
  • Thank you. My current installation works when `copy_csv_x‌​ls_pdf.swf` and `ZeroClipboard.swf` is referenced via absolute urls to the local server. – Stefan Aug 08 '13 at 05:56
2

Basically the problem is about the specify the swf path incorrectly.

"sSwfPath": "http://localhost/TableTools/media/swf/ZeroClipboard.swf"

Try to replace this path with

"sSwfPath": "../media/swf/ZeroClipboard.swf"
Didier Ghys
  • 30,396
  • 9
  • 75
  • 81
NiL
  • 21
  • 2
  • even me to have the problem. I foud that when i hover on the swf the pointer doesnt change to click pinter whereas for print it does do – Angelin Nadar Aug 23 '12 at 08:01
0

Think this will help

"sDom": 'T<"H"plfr>t<"F"ip>',
"oTableTools": {
            "aButtons": [ "csv", "pdf" ],
            "sSwfPath": "https://datatables.net/release-datatables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
        }