Skip to content

Instantly share code, notes, and snippets.

@lemoinem
Last active October 31, 2016 09:04
Show Gist options
  • Save lemoinem/5765881 to your computer and use it in GitHub Desktop.
Save lemoinem/5765881 to your computer and use it in GitHub Desktop.
tablesorter parser using data-tablesorter-value to sort and filter
/*! data attribute parser
* This parser will use the data-tablesorter-value to extract the cell's value
* Written by Mathieu Lemoine :https://github.com/lemoinem
*/
/*global jQuery: false */
;(function($){
"use strict";
$.tablesorter.addParser({
id : 'data-attribute',
format : function(s, table, cell) {
return String($(cell).data("tablesorter-value"));
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment