【问题标题】:Issue with tabletool of datatable with pdf, csv, xls and copy options带有 pdf、csv、xls 和复制选项的数据表的 tabletool 问题
【发布时间】:2015-07-08 21:36:09
【问题描述】:
sTable = $('#s').dataTable({
        "bVisible":"True",
        "dom": 'T<"clear">lfrtip',        
        "tableTools": {           
            "sSwfPath": "https://cdn.datatables.net/tabletools/2.1.1/swf/copy_csv_xls_pdf.swf",            
            "aButtons": [ 
               "copy", 
               "csv", 
               "xls",            
               "pdf",
               "print",
               "select_all", 
               "select_none" 
            ]
        }
});

按钮显示正常,但 copy、csv、xls、pdf 不起作用,我没有收到任何 404,我已在浏览器控制台中检查,但我正在使用过滤器按钮动态加载总数据表和按钮的容器.这可能会导致问题,请帮助我。

【问题讨论】:

    标签: javascript jquery datatables tabletools


    【解决方案1】:

    您的浏览器 Adob​​e Flash Player 插件已禁用、对该特定页面禁用或根本未安装。

    【讨论】:

    • 感谢您的回复,我已经在我的 chrome 中启用了 flash,但这些按钮仍然不起作用..
    【解决方案2】:

    最后我得到了解决方案,它工作正常.. 问题是我的按钮是隐藏的,所以在初始化时它没有得到我的 tabletool 按钮的高度和宽度。所以我在回调函数上创建了一个函数,它添加了按钮的宽度和高度。

    funtion m(){
      $('[id^=ToolTables_] embed').each(function( index ) {
      $(this).attr('width','47px');
      $(this).attr('height','47px');       
      });
      }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-28
      • 1970-01-01
      • 1970-01-01
      • 2014-06-06
      • 2019-05-13
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      相关资源
      最近更新 更多