Lines 55-60
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
Link Here
|
55 |
} |
55 |
} |
56 |
} ); |
56 |
} ); |
57 |
|
57 |
|
|
|
58 |
/* Plugin to allow sorting numerically on data stored in a span's title attribute |
59 |
* |
60 |
* Ex: <td><span title="[% total %]">Total: [% total %]</span></td> |
61 |
* |
62 |
* In DataTables config: |
63 |
* "aoColumns": [ |
64 |
* { "sType": "title-numeric" } |
65 |
* ] |
66 |
* http://legacy.datatables.net/plug-ins/sorting#hidden_title |
67 |
*/ |
68 |
jQuery.extend( jQuery.fn.dataTableExt.oSort, { |
69 |
"title-numeric-pre": function ( a ) { |
70 |
console.log(a); |
71 |
var x = a.match(/title="*(-?[0-9\.]+)/)[1]; |
72 |
return parseFloat( x ); |
73 |
}, |
74 |
|
75 |
"title-numeric-asc": function ( a, b ) { |
76 |
return ((a < b) ? -1 : ((a > b) ? 1 : 0)); |
77 |
}, |
78 |
|
79 |
"title-numeric-desc": function ( a, b ) { |
80 |
return ((a < b) ? 1 : ((a > b) ? -1 : 0)); |
81 |
} |
82 |
} ); |
83 |
|
58 |
(function() { |
84 |
(function() { |
59 |
|
85 |
|
60 |
/* Plugin to allow text sorting to ignore articles |
86 |
/* Plugin to allow text sorting to ignore articles |
61 |
- |
|
|