问题
Is it possible to check inside format function which was used: ASC or DESC sorting? I want to change number format in sorting when column is sorted DESC.
回答1:
Short answer: No.
Parsers can only format the text obtained from the table into a more sortable-friendly format (e.g. converting a date into a number that can be sorted and/or compared).
To mess with how a sort is done, you'll need to use the numberSorter option to detect sort direction, then do whatever it is you wanted to do.
If, by chance, you mean change the visually displayed numbers of the table, you'll need to write a custom widget. I could help, but without any code or examples, I would only be guessing at what you are trying to accomplish.
来源:https://stackoverflow.com/questions/20798504/tablesorter-custom-parser-dependent-on-sorting-type