csv - jQuery dataTables - TableTools 不工作

标签 csv datatables flash jquery-datatables tabletools

我正在使用 http://datatables.net/extensions/tabletools/在我的本地主机( wamp 服务器)中。它工作正常,但是当我将相同的代码放在我的在线服务器上时,它不起作用。

我正在使用所有最新版本的数据表

tableTools: {
    "sSwfPath": "https://datatables.net/release-datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf",
    "sRowSelect": "os",
    "sRowSelector": 'td:first-child',
    // "aButtons": [ "copy", "csv", "xls","pdf","print","select_all", "select_none" ]
    "aButtons": [
        "copy",
        "print", {
            "sExtends": "collection",
            "sButtonText": "Save", // button name 
            // "aButtons":    [ "csv", "xls", "pdf" ]
            "aButtons": [
                "csv",
                "xls", {
                    "sExtends": "pdf",
                    "sPdfOrientation": "landscape",
                    "sPdfMessage": "List of product."
                },
                "print"
            ]
        }
    ]
}    

首先没有点击复制、pdf、csv、xls 按钮。因此我教了我的路径或 swf 不起作用,因此我用在线链接替换了链接。因此,现在我得到了点击,但是当我点击复制按钮时,它给了我一条消息……但是当我在记事本中过去时,它给了我“空白”。我的 pdf、csv、xlsx 也不起作用。只有打印工作完美。请让我知道是什么问题,因为在我的本地主机中一切正常。它在我的在线服务器中产生问题。

最佳答案

我很确定 datatables.net 正在积极阻止使用 .swf . Allan Jardine 评论了 .swf 的直接使用文件 several times :

datatables.net is not a CDN server and should not be used as such. It is not designed to be, and I might add throttling for hotlinking in future as a huge amount of bandwidth is being used and causing unnecessary load. You'll get much better performance from using a proper CDN or even a locally hosted file.



但是,随着1.10.x的推出,终于建立了一个真正的CDN服务器,包括所有TableTools资源-> http:// CDN .datatables.net/tabletools/2.2.2/

所以更换sSwfPath和 :

http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf

关于csv - jQuery dataTables - TableTools 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24837595/

相关文章:

python - 这 8 行 python + pandas 需要大约 1 个月才能执行,能帮我加快速度吗?

python - 使用 Python 编码东亚语言

csv - sqlite3 没有给出这样的表错误

javascript - 使用 JavaScript 为 DataTables 生成变量 HTML 表

flash - 播放闪光灯时音频失真

python - 从字典中删除双引号?

jquery - 数据表 - 设置后强制渲染 `bDeferRender: true`

laravel - 我可以使用标题列搜索数据表 laravel 而不是页脚列搜索

flash - 如何缩放填充而不是Actionscript中的笔划?

google-chrome - 在 Ubuntu 14.04 上的 Headless Chrome 中运行 Flash 网页