[英]How to sort two columns at once in datatables
I have a table like below , I want to sort column A ascending and column B descending. 我有一个像下面的表格,我想对A列升序和B列降序进行排序。
ABC 1 4 string1 2 11 string2 1 13 string3 2 43 string4
And, I want to sort by both A (ascending) and B (descending) at once, to get this: 而且,我想同时按A(升序)和B(降序)进行排序,以获得以下信息:
ABC 1 13 string3 1 4 string1 2 43 string4 2 11 string2
Right now I can able to sort one column with following code 现在,我可以使用以下代码对一列进行排序
oTable.api().columns( ['.acol'] ).order("asc").draw();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.