about summary refs log tree commit diff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/wqflask/templates/show_trait.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index d6f22f41..c646bf9f 100755
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -146,7 +146,7 @@
            function getValue(x) {
                 if (x.indexOf('input') >= 0) {
                     if ($(x).val() == 'x') {
-                        return 0
+                        return 'x'
                     }
                     else {
                        return parseFloat($(x).val());
@@ -164,7 +164,16 @@
             jQuery.fn.dataTableExt.oSort['cust-txt-desc'] = function (a, b) {
                 var x = getValue(a);
                 var y = getValue(b);
-                return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+
+                if (x == 'x') {
+                    return 1;
+                }
+                else if (y == 'x') {
+                    return -1;
+                }
+                else {
+                    return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+                }
             };
             
             $(document).ready( function () {