Custom Sorting with JQuery datatables

十年热恋 提交于 2020-01-06 05:59:31

问题


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"


回答1:


The enum plugin should work:

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

Working example here.



来源:https://stackoverflow.com/questions/48886779/custom-sorting-with-jquery-datatables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!