jQuery TableTools not working

2019-01-27 10:36发布

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>

3条回答
戒情不戒烟
2楼-- · 2019-01-27 11:04

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"
查看更多
虎瘦雄心在
3楼-- · 2019-01-27 11:15

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"
        }
查看更多
相关推荐>>
4楼-- · 2019-01-27 11:23

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.

查看更多
登录 后发表回答