joequery/Stupid-Table-Plugin

Allow custom sorting

Closed this issue · 3 comments

This came up with a client who is trying to use the table sorter for a column with currency, eg. £10.10. As this is being used in a Drupal site, and the WYSIWYG's table editor does not support custom attributes for table cells, it would be too much pain for them to edit each cell to add data-sort-value="10.10" etc.

A possible solution would be for the library to support custom sort functions so users could specify a new data type, eg, currency, and we can augment the library with a function for that, which can simply use regex etc for the data sort values.

I've seen this in another library: http://tablesorter.com/docs/example-parsers.html

Thank you!

We got you covered! :)

Great, thanks!