I'm using the jQuery tablesorter plugin and I have a column that contains name of month and year like this
April, 1975 January, 2001
I would like to sort this column as if it were a date column. As I understand it, it is possible to sort the column with some other 'hidden' value, but I just can't seem to find the documentation for that feature. Any help out there?
Update
This fork http://mottie.github.com/tablesorter/docs/index.html of the tablesorter had just what I needed; the ability to store the value to sort by in an attribute, worked really great.
How to start using jQuery? More in this category... tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes and any server-side code. tablesorter can successfully parse and sort many types of data including linked data in a cell.
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes and any server-side code. tablesorter can successfully parse and sort many types of data including linked data in a cell.
This list contains DOM elements (not jQuery objects of each table header cell like the $headers variable) and is how the original version of tablesorter stored these objects. It is not used in the current version of tablesorter, and is only left in place for backwards compatibility with widgets written for the original tablesorter plugin.
Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria) Works with jQuery 1.2.6+ (jQuery 1.4.1+ needed with some widgets). Works with jQuery 1.9+ ($.browser.msie was removed; needed in the original version). TIP!
Just using the textExtraction function. Set data-sort-value on your TDs. Defaults to normal text if it's not present.
$(".sort-table").tablesorter({ textExtraction: function(node) { var attr = $(node).attr('data-sort-value'); if (typeof attr !== 'undefined' && attr !== false) { return attr; } return $(node).text(); } });
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