Created
December 4, 2013 10:43
-
-
Save domenu/7785602 to your computer and use it in GitHub Desktop.
Tablesorter: sort checbox columns
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
// 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