X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6a7e4474cba9d8be4b2ec445e10f1691f7277c50:/src/data/SortTypes.js diff --git a/src/data/SortTypes.js b/src/data/SortTypes.js index 05fa285a..508b171f 100644 --- a/src/data/SortTypes.js +++ b/src/data/SortTypes.js @@ -1,91 +1,91 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC + * Ext JS Library 3.2.0 + * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license */ - -/** - * @class Ext.data.SortTypes - * @singleton - * Defines the default sorting (casting?) comparison functions used when sorting data. - */ -Ext.data.SortTypes = { - /** - * Default sort that does nothing - * @param {Mixed} s The value being converted - * @return {Mixed} The comparison value - */ - none : function(s){ - return s; - }, - - /** - * The regular expression used to strip tags - * @type {RegExp} - * @property - */ - stripTagsRE : /<\/?[^>]+>/gi, - - /** - * Strips all HTML tags to sort on text only - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ - asText : function(s){ - return String(s).replace(this.stripTagsRE, ""); - }, - - /** - * Strips all HTML tags to sort on text only - Case insensitive - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ - asUCText : function(s){ - return String(s).toUpperCase().replace(this.stripTagsRE, ""); - }, - - /** - * Case insensitive string - * @param {Mixed} s The value being converted - * @return {String} The comparison value - */ - asUCString : function(s) { - return String(s).toUpperCase(); - }, - - /** - * Date sorting - * @param {Mixed} s The value being converted - * @return {Number} The comparison value - */ - asDate : function(s) { - if(!s){ - return 0; - } - if(Ext.isDate(s)){ - return s.getTime(); - } - return Date.parse(String(s)); - }, - - /** - * Float sorting - * @param {Mixed} s The value being converted - * @return {Float} The comparison value - */ - asFloat : function(s) { - var val = parseFloat(String(s).replace(/,/g, "")); - return isNaN(val) ? 0 : val; - }, - - /** - * Integer sorting - * @param {Mixed} s The value being converted - * @return {Number} The comparison value - */ - asInt : function(s) { - var val = parseInt(String(s).replace(/,/g, ""), 10); - return isNaN(val) ? 0 : val; - } + +/** + * @class Ext.data.SortTypes + * @singleton + * Defines the default sorting (casting?) comparison functions used when sorting data. + */ +Ext.data.SortTypes = { + /** + * Default sort that does nothing + * @param {Mixed} s The value being converted + * @return {Mixed} The comparison value + */ + none : function(s){ + return s; + }, + + /** + * The regular expression used to strip tags + * @type {RegExp} + * @property + */ + stripTagsRE : /<\/?[^>]+>/gi, + + /** + * Strips all HTML tags to sort on text only + * @param {Mixed} s The value being converted + * @return {String} The comparison value + */ + asText : function(s){ + return String(s).replace(this.stripTagsRE, ""); + }, + + /** + * Strips all HTML tags to sort on text only - Case insensitive + * @param {Mixed} s The value being converted + * @return {String} The comparison value + */ + asUCText : function(s){ + return String(s).toUpperCase().replace(this.stripTagsRE, ""); + }, + + /** + * Case insensitive string + * @param {Mixed} s The value being converted + * @return {String} The comparison value + */ + asUCString : function(s) { + return String(s).toUpperCase(); + }, + + /** + * Date sorting + * @param {Mixed} s The value being converted + * @return {Number} The comparison value + */ + asDate : function(s) { + if(!s){ + return 0; + } + if(Ext.isDate(s)){ + return s.getTime(); + } + return Date.parse(String(s)); + }, + + /** + * Float sorting + * @param {Mixed} s The value being converted + * @return {Float} The comparison value + */ + asFloat : function(s) { + var val = parseFloat(String(s).replace(/,/g, "")); + return isNaN(val) ? 0 : val; + }, + + /** + * Integer sorting + * @param {Mixed} s The value being converted + * @return {Number} The comparison value + */ + asInt : function(s) { + var val = parseInt(String(s).replace(/,/g, ""), 10); + return isNaN(val) ? 0 : val; + } }; \ No newline at end of file