【问题标题】:bootstrap datatables export buttons引导数据表导​​出按钮
【发布时间】:2016-03-07 17:22:08
【问题描述】:
<script>
$(document).ready(function() {
$('#example').DataTable( {
    "language": {
        "url": "../jquery/plugins/dataTables/ff.json"
        },
        "columns": [ null, null, { "width": "6%" }, { "width": "6%" } ],
        "order": [],
        "columnDefs": [ {"targets"  : 'no-sort', "orderable": false} ],
        "dom": 'Bfrtip',
        "buttons": [ 'copyHtml5', 'excelHtml5', 'csvHtml5', 'pdfHtml5' ]            
 });
$("[data-toggle=tooltip]").tooltip();

});

任何人都可以帮助我...除了显示导出按钮之外一切正常...提前感谢您的帮助

【问题讨论】:

  • 究竟是什么不工作?

标签: jquery twitter-bootstrap button datatables


【解决方案1】:

您必须包含额外的 JS 文件才能使 HTML5 导出按钮起作用。

使用Download Builder 并生成包含以下组件的 JS/CSS 链接:

  • 按钮

    • HTML5 导出
    • JSZip
    • pdfmake
$('#example').DataTable( {
    "language": {
       "url": "../jquery/plugins/dataTables/ff.json"
    },
    "columns": [ null, null, { "width": "6%" }, { "width": "6%" } ],
    "order": [],
    "columnDefs": [ {"targets"  : 'no-sort', "orderable": false} ],
    "dom": 'Bfrtip',
    "buttons": [ 'copyHtml5', 'excelHtml5', 'csvHtml5', 'pdfHtml5' ]            
 });

请参阅this jsFiddle 进行演示。

【讨论】:

  • @Lef,添加了演示以证明它有效。很可能您没有包含正确的文件。
猜你喜欢
  • 1970-01-01
  • 2023-03-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-08
  • 2020-02-01
  • 2017-08-12
相关资源
最近更新 更多