a:8:{s:9:"#provides";s:21:"dojo.data.util.sorter";s:9:"#resource";s:19:"data/util/sorter.js";s:37:"dojo.data.util.sorter.basicComparator";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:1:"a";a:1:{s:4:"type";s:8:"anything";}s:1:"b";a:1:{s:4:"type";s:8:"anything";}}s:6:"source";s:179:" var r = -1; if(a === null){ a = undefined; } if(b === null){ b = undefined; } if(a == b){ r = 0; }else if(a > b || a == null){ r = 1; } return r; //int {-1,0,1}";s:7:"summary";s:88:"Basic comparision function that compares if an item is greater or less than another item";s:11:"description";s:437:"returns 1 if a > b, -1 if a < b, 0 if equal. 'null' values (null, undefined) are treated as larger values so that they're pushed to the end of the list. And compared to each other, null is equivalent to undefined. null is a problematic compare, so if null, we set to undefined. Makes the check logic simple, compact, and consistent And (null == undefined) === true, so the check later against null works for undefined and is less bytes.";s:7:"returns";s:12:"int {-1,0,1}";}s:40:"dojo.data.util.sorter.createSortFunction";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:8:"sortSpec";a:2:{s:4:"type";s:16:"attributes array";s:7:"summary";s:279:"array A JS object that array that defines out what attribute names to sort on and whether it should be descenting or asending. The objects should be formatted as follows: { attribute: "attributeName-string" || attribute, descending: true|false; // Default is false. }";}s:5:"store";a:2:{s:4:"type";s:19:"dojo.data.core.Read";s:7:"summary";s:56:"object The datastore object to look up item values from.";}}s:6:"source";s:1052:" var sortFunctions=[]; function createSortFunction(attr, dir){ return function(itemA, itemB){ var a = store.getValue(itemA, attr); var b = store.getValue(itemB, attr); //See if we have a override for an attribute comparison. var comparator = null; if(store.comparatorMap){ if(typeof attr !== "string"){ attr = store.getIdentity(attr); } comparator = store.comparatorMap[attr]||dojo.data.util.sorter.basicComparator; } comparator = comparator||dojo.data.util.sorter.basicComparator; return dir * comparator(a,b); //int }; } var sortAttribute; for(var i = 0; i < sortSpec.length; i++){ sortAttribute = sortSpec[i]; if(sortAttribute.attribute){ var direction = (sortAttribute.descending) ? -1 : 1; sortFunctions.push(createSortFunction(sortAttribute.attribute, direction)); } } return function(rowA, rowB){ var i=0; while(i < sortFunctions.length){ var ret = sortFunctions[i++](rowA, rowB); if(ret !== 0){ return ret;//int } } return 0; //int }; // Function";s:7:"summary";s:87:"Helper function to generate the sorting function based off the list of sort attributes.";s:11:"description";s:397:"The sort function creation will look for a property on the store called 'comparatorMap'. If it exists it will look in the mapping for comparisons function for the attributes. If one is found, it will use it instead of the basic comparator, which is typically used for strings, ints, booleans, and dates. Returns the sorting function for this particular list of attributes and sorting directions.";s:7:"returns";s:3:"int";}s:21:"dojo.data.util.sorter";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:14:"dojo.data.util";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:9:"dojo.data";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}