stringify to sort numbers
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 2 Sep 2006 20:20:25 +0000 (20:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 2 Sep 2006 20:20:25 +0000 (20:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5871 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/non_cat_types.js

index 757c2a0..4679989 100644 (file)
@@ -70,8 +70,10 @@ function ncDisplayTypes(r) {
        removeChildren(tbody);
        types = types.sort( 
                function(a,b) {
-                       if( a.name().toLowerCase() > b.name().toLowerCase() ) return 1; 
-                       if( a.name().toLowerCase() < b.name().toLowerCase() ) return -1;        
+                       try {
+                               if( a.name()+''.toLowerCase() > b.name()+''.toLowerCase() ) return 1;   
+                               if( a.name()+''.toLowerCase() < b.name()+''.toLowerCase() ) return -1;  
+                       } catch(e) {}
                        return 0;
                });