-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjquery.tablesorter.parsers.js
More file actions
46 lines (39 loc) · 1.02 KB
/
jquery.tablesorter.parsers.js
File metadata and controls
46 lines (39 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
*
* jQuery table sorter additionnal parsers
*
* @copyright sailingcat.github.io
*/
;(function(w) {
"use strict";
$.tablesorter.addParser({
id: "input-checkbox",
is: function(s) {
return false;
},
format: function(s, t, node) {
return $(node).children("input[type=checkbox]").is(':checked') ? 1 : 0;
},
type: "numeric"
});
$.tablesorter.addParser({
id: "input-text",
is: function(s) {
return false;
},
format: function(s, t, node) {
return $(node).children("input[type=text]").val();
},
type: "text"
});
$.tablesorter.addParser({
id: "input-text-numeric",
is: function(s) {
return false;
},
format: function(s, t, node) {
return parseInt($(node).children("input[type=text]").val());
},
type: "numeric"
});
})(window);