3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js">
\r
10 <div id="cls-Ext.data.SortTypes"></div>/**
\r
11 * @class Ext.data.SortTypes
\r
13 * Defines the default sorting (casting?) comparison functions used when sorting data.
\r
15 Ext.data.SortTypes = {
\r
16 <div id="method-Ext.data.SortTypes-none"></div>/**
\r
17 * Default sort that does nothing
\r
18 * @param {Mixed} s The value being converted
\r
19 * @return {Mixed} The comparison value
\r
25 <div id="prop-Ext.data.SortTypes-stripTagsRE"></div>/**
\r
26 * The regular expression used to strip tags
\r
30 stripTagsRE : /<\/?[^>]+>/gi,
\r
32 <div id="method-Ext.data.SortTypes-asText"></div>/**
\r
33 * Strips all HTML tags to sort on text only
\r
34 * @param {Mixed} s The value being converted
\r
35 * @return {String} The comparison value
\r
37 asText : function(s){
\r
38 return String(s).replace(this.stripTagsRE, "");
\r
41 <div id="method-Ext.data.SortTypes-asUCText"></div>/**
\r
42 * Strips all HTML tags to sort on text only - Case insensitive
\r
43 * @param {Mixed} s The value being converted
\r
44 * @return {String} The comparison value
\r
46 asUCText : function(s){
\r
47 return String(s).toUpperCase().replace(this.stripTagsRE, "");
\r
50 <div id="method-Ext.data.SortTypes-asUCString"></div>/**
\r
51 * Case insensitive string
\r
52 * @param {Mixed} s The value being converted
\r
53 * @return {String} The comparison value
\r
55 asUCString : function(s) {
\r
56 return String(s).toUpperCase();
\r
59 <div id="method-Ext.data.SortTypes-asDate"></div>/**
\r
61 * @param {Mixed} s The value being converted
\r
62 * @return {Number} The comparison value
\r
64 asDate : function(s) {
\r
71 return Date.parse(String(s));
\r
74 <div id="method-Ext.data.SortTypes-asFloat"></div>/**
\r
76 * @param {Mixed} s The value being converted
\r
77 * @return {Float} The comparison value
\r
79 asFloat : function(s) {
\r
80 var val = parseFloat(String(s).replace(/,/g, ""));
\r
81 return isNaN(val) ? 0 : val;
\r
84 <div id="method-Ext.data.SortTypes-asInt"></div>/**
\r
86 * @param {Mixed} s The value being converted
\r
87 * @return {Number} The comparison value
\r
89 asInt : function(s) {
\r
90 var val = parseInt(String(s).replace(/,/g, ""), 10);
\r
91 return isNaN(val) ? 0 : val;
\r