2016-03-07 80 views
0
<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(); 

}); 自举数据表导出按钮

任何人可以帮助我......一切工作,除了显示出口按钮...预先感谢您的帮助

+1

什么不工作? –

回答

0

你必须包括额外的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示范。

+0

做到了这一点,但仍然没有...谢谢 – Lef

+0

@Lef,增加了演示,以表明它的工作原理。很可能你没有包含正确的文件。 –