![](/img/trans.png)
[英]How to hide or show column of table created using datatables in javascript?
[英]DataTables: how to reorder a column in datatables using Javascript or any function
我正在使用datatables的 ColReorder擴展。 我想使用某些功能重新排列表格中的列,而不是手動拖動該列。 我知道有一個函數order()
以數組作為參數。
但是此方法一次移動單個列的效果不好,因為當列數很大時,它會限制性能
您必須以新order
傳遞數組:
var table = $('#table').DataTable({ colReorder: true });
$('button#newOrder').click(function() {
table.colReorder.order([3,4,2,0,1], true);
});
在此處查看更多詳細信息https://datatables.net/reference/api/colReorder.order()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.