数据表工具副本,pdf.csv,excel 导出不起作用.只有打印在工作 [英] datatable tools copy, pdf. csv, excel export didnt work. only print is working

查看:15
本文介绍了数据表工具副本,pdf.csv,excel 导出不起作用.只有打印在工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 datatables 来满足我的前端要求,它运行良好,除了我在导出内容时遇到问题,例如复制、csv、excel 和 pdf,只有打印才有效.任何想法,线索,想法,帮助,建议,推荐?我使用的是 1.10.6 版

im using datatables for my front end requirements and it works good except im having an issue in exporting stuff e.g. copy, csv, excel and pdf, only print is working. Any ideas, clues, thoughts, help, suggestions, recommendation? I'm using version 1.10.6

我确实链接了所有必要的库,例如数据表js、css和数据表工具js.下面是我在脚本上激活它的代码

I did link all the necessary libraries e.g. datatables js, css and datatables tools js. Below is my code for activating it on my script

$('#cigptable').DataTable( {
            "pagingType": "full_numbers",
            "dom": 'T<"clear">lfrtip',
            "tableTools": {
                "sSwfPath": "../../../plugins/datatables/extensions/TableTools/swf/copy_csv_xls_pdf.swf"
            },
            "oLanguage": {
            "oPaginate": {
              "sPrevious": '<i class="ion-ios-arrow-left"></i>',
              "sNext": '<i class="ion-ios-arrow-right"></i>'
            }
          }
}); 

推荐答案

参见 sSwfPath选项文档,以下是摘录:

See sSwfPath option documentation, below is an excerpt:

sSwfPath 定义 TableTools 用于复制到剪贴板和本地保存文件操作的 SWF 的路径.如果您在执行这些操作时遇到问题,但没有打印,这很可能就是问题所在.

sSwfPath Define the path of the SWF to be used by TableTools for copy to clipboard and saving a file locally operations. If you are having problems with these operations, but not printing, this is very likely to be the issue.

问题很可能是因为copy_csv_xls_pdf.swf 文件的路径不正确.尝试使用 CDN 链接:

Most likely the problem is because of the incorrect path to the copy_csv_xls_pdf.swf file. Try to use CDN link instead:

//cdn.datatables.net/tabletools/2.2.4/swf/copy_csv_xls_pdf.swf

引用 Allan Jardine,DataTables 的开发者:

Quoting Allan Jardine, developer of DataTables:

此外,它无法从本地驱动器运行,除非您为 Flash 设置了安全例外.您可以在此处更改全局安全设置:http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html.

Also, it won't work from a local drive, unless you have a security exception set up for Flash. You can change the Global Security Settings here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html.

这篇关于数据表工具副本,pdf.csv,excel 导出不起作用.只有打印在工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆