如何告诉DataTables导出按钮的插入位置 [英] How to tell DataTables where to insert the buttons export
本文介绍了如何告诉DataTables导出按钮的插入位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用数据表来归档类似内容
I wanna archive something like this with datatables
但是我找不到一种方法来告诉数据表在哪里插入按钮副本,excel,PDF等.默认的插入按钮数据表将像这样替换sorting entries
But I can't find a way how to tell datatable where to insert button copy, excel,PDF etc. Default insert button datatable will replace sorting entries
like this
这是我的代码
<div class="box-header">
<div class="buttonContainer"></div>
<div class="pull-right">
<button class="btn btn-primary form-button" id="addNew">Tambah Produk</button>
</div>
</div>
和
var dTable;
dTable = $('#dataTable').DataTable({
"bProcessing": true,
"bAutoWidth": false,
"responsive": true,
"buttons": [ 'copy', 'excel','csv','pdf'],
});
我想在buttonContainer
我在这里 dom datatable
但不太了解如何在我的情况下实现它
but not quite understand how to implement it in my case
请帮助
推荐答案
解决方案
使用值为Bfrtip
的 dom
选项.
Use dom
option with the value Bfrtip
.
var dTable = $('#dataTable').DataTable({
"dom": "Bfrtip"
"bProcessing": true,
"bAutoWidth": false,
"responsive": true,
"buttons": [ 'copy', 'excel','csv','pdf']
});
演示
有关代码和演示,请参见此jsFiddle .
See this jsFiddle for code and demonstration.
这篇关于如何告诉DataTables导出按钮的插入位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文