Using jquery-datatables.
Example: http://jsfiddle.net/b2fLye17/17/
$('#example').DataTable({ filter:false, columnDefs: [ { targets: [1],//when sorting age column orderData: [1,2] //sort by age then by salary } ] });
When you click the age column, the table is sorted by age, and then by salary in ascending order.
What will be my options to sort by age, and then by lowering wages?
Thanks!
-------------------------- Edit 1 ------------------- -
Explanation: When an age column is sorted in ascending order, it should be sorted by age, and then by lowering the salary. When an age column is sorted in descending order, it should be sorted by age, and then by salary in ascending order.
-------------------------- Edit 2 ------------------- -
Image of the desired result
source share