Skip to content

Instantly share code, notes, and snippets.

@domenu
Created December 4, 2013 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domenu/7785602 to your computer and use it in GitHub Desktop.
Save domenu/7785602 to your computer and use it in GitHub Desktop.
Tablesorter: sort checbox columns
// add tablesorter parser to be able to sort on checkboxes
$.tablesorter.addParser({
id: 'checkbox',
is: function (s, table, cell) {
return $(cell).find('input[type=checkbox]').length > 0;
},
format: function (s, table, cell) {
return $(cell).find('input:checked').length > 0 ? 0 : 1;
},
type: "numeric"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment