3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">
\r
9 <div id="cls-Ext.data.SortTypes"></div>/**
\r
10 * @class Ext.data.SortTypes
\r
12 * Defines the default sorting (casting?) comparison functions used when sorting data.
\r
14 Ext.data.SortTypes = {
\r
15 <div id="method-Ext.data.SortTypes-none"></div>/**
\r
16 * Default sort that does nothing
\r
17 * @param {Mixed} s The value being converted
\r
18 * @return {Mixed} The comparison value
\r
24 <div id="prop-Ext.data.SortTypes-stripTagsRE"></div>/**
\r
25 * The regular expression used to strip tags
\r
29 stripTagsRE : /<\/?[^>]+>/gi,
\r
31 <div id="method-Ext.data.SortTypes-asText"></div>/**
\r
32 * Strips all HTML tags to sort on text only
\r
33 * @param {Mixed} s The value being converted
\r
34 * @return {String} The comparison value
\r
36 asText : function(s){
\r
37 return String(s).replace(this.stripTagsRE, "");
\r
40 <div id="method-Ext.data.SortTypes-asUCText"></div>/**
\r
41 * Strips all HTML tags to sort on text only - Case insensitive
\r
42 * @param {Mixed} s The value being converted
\r
43 * @return {String} The comparison value
\r
45 asUCText : function(s){
\r
46 return String(s).toUpperCase().replace(this.stripTagsRE, "");
\r
49 <div id="method-Ext.data.SortTypes-asUCString"></div>/**
\r
50 * Case insensitive string
\r
51 * @param {Mixed} s The value being converted
\r
52 * @return {String} The comparison value
\r
54 asUCString : function(s) {
\r
55 return String(s).toUpperCase();
\r
58 <div id="method-Ext.data.SortTypes-asDate"></div>/**
\r
60 * @param {Mixed} s The value being converted
\r
61 * @return {Number} The comparison value
\r
63 asDate : function(s) {
\r
70 return Date.parse(String(s));
\r
73 <div id="method-Ext.data.SortTypes-asFloat"></div>/**
\r
75 * @param {Mixed} s The value being converted
\r
76 * @return {Float} The comparison value
\r
78 asFloat : function(s) {
\r
79 var val = parseFloat(String(s).replace(/,/g, ""));
\r
80 return isNaN(val) ? 0 : val;
\r
83 <div id="method-Ext.data.SortTypes-asInt"></div>/**
\r
85 * @param {Mixed} s The value being converted
\r
86 * @return {Number} The comparison value
\r
88 asInt : function(s) {
\r
89 var val = parseInt(String(s).replace(/,/g, ""), 10);
\r
90 return isNaN(val) ? 0 : val;
\r