Last active
October 31, 2016 09:04
-
-
Save lemoinem/5765881 to your computer and use it in GitHub Desktop.
tablesorter parser using data-tablesorter-value to sort and filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! 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