Custom Sorting with JQuery datatables

2019-08-28 05:24发布

I want to sort data through Jquery datatable in particular column. Requirement is, records to be displayed with data as "NA" first and then other records to be displayed by Ascending order. For example:

Current Order: "A" "B" "NA" "D" "NA"

Result: "NA" "NA" "A" "B" "C" "D"

标签: datatables
1条回答
来,给爷笑一个
2楼-- · 2019-08-28 05:51

The enum plugin should work:

$.fn.dataTable.enum( [ 'NA', 'A', 'B', 'C', 'D' ] );
$('#example').DataTable();

Working example here.

查看更多
登录 后发表回答