I remember once I used some API to get table's sorted column info but I couldn't find now. I want to find which column currently is used for sorted and in which order? Since I am using both legacy and new DataTable in different project in different company I will appreciate if some one can provide PAI for both version.
Assuming your table has an id of mytable
var sortedCol = $('#mytable').dataTable().fnSettings().aaSorting[0][0];
var sortedDir = $('#mytable').dataTable().fnSettings().aaSorting[0][1];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With