Ticket #2542: dojo.data.util.sorter_20070429.patch
| File dojo.data.util.sorter_20070429.patch, 0.8 kB (added by guest, 20 months ago) |
|---|
-
F:/inetpub/www/js/anon/dojo/anon/dojo/data/util/sorter.js
6 6 // Basic comparision function that compares if an item is greater or less than another item 7 7 // description: 8 8 // returns 1 if a > b, -1 if a < b, 0 if equal. 9 // undefined values are treated as larger values so that they're pushed to the end of the list. 9 10 10 11 var ret = 0; 11 if(a > b ){12 if(a > b || typeof a === "undefined"){ 12 13 ret = 1; 13 }else if(a < b ){14 }else if(a < b || typeof b === "undefined"){ 14 15 ret = -1; 15 16 } 16 17 return ret; //int, {-1,0,1}