Tablesorter - custom parser dependent on sorting t

2019-08-15 00:28发布

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条回答
甜甜的少女心
2楼-- · 2019-08-15 00:42

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.

查看更多
登录 后发表回答