Skip to content

Instantly share code, notes, and snippets.

@lemoinem
Last active October 31, 2016 09:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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