[英]Multiple DataTables with same Sorting filter
有沒有一種方法可以將相同的篩選器應用於多個數據表? 我的意思是:如果我有table A
和table B
,和我有點table A
的Date
,我想table B
排序以及通過Date
您可以使用datatable order事件 ,然后按 tableA順序對tableB列進行排序。
例:
$(document).ready(function() {
var table1 = $('#example').DataTable();
var table2 = $('#example2').DataTable();
$('#example').on( 'order.dt', function () {
var order = table1.order();
table2
.column( order[0][0] )
.order( order[0][1] )
.draw();
} );
} );
查看現場示例:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.