-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-JSON'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-JSON'>/**
</span> * @class Ext.JSON
- * Modified version of Douglas Crockford"s json.js that doesn"t
+ * Modified version of Douglas Crockford's JSON.js that doesn't
* mess with the Object prototype
* http://www.json.org/js.html
* @singleton
* <b>The returned value includes enclosing double quotation marks.</b></p>
* <p>The default return format is "yyyy-mm-ddThh:mm:ss".</p>
* <p>To override this:</p><pre><code>
- Ext.JSON.encodeDate = function(d) {
- return d.format('"Y-m-d"');
- };
+Ext.JSON.encodeDate = function(d) {
+ return Ext.Date.format(d, '"Y-m-d"');
+};
</code></pre>
* @param {Date} d The Date to encode
* @return {String} The string literal to use in a JSON string.
*/
this.encodeDate = function(o) {
- return '"' + o.getFullYear() + "-"
+ return '"' + o.getFullYear() + "-"
+ pad(o.getMonth() + 1) + "-"
+ pad(o.getDate()) + "T"
+ pad(o.getHours()) + ":"
<span id='Ext-JSON-method-encode'> /**
</span> * Encodes an Object, Array or other value
- * @param {Mixed} o The variable to encode
+ * @param {Object} o The variable to encode
* @return {String} The JSON string
*/
this.encode = function() {
Ext.Error.raise({
sourceClass: "Ext.JSON",
sourceMethod: "decode",
- msg: "You're trying to decode and invalid JSON String: " + json
+ msg: "You're trying to decode an invalid JSON String: " + json
});
}
};
})();
<span id='Ext-method-encode'>/**
</span> * Shorthand for {@link Ext.JSON#encode}
- * @param {Mixed} o The variable to encode
- * @return {String} The JSON string
* @member Ext
* @method encode
+ * @alias Ext.JSON#encode
*/
Ext.encode = Ext.JSON.encode;
<span id='Ext-method-decode'>/**
</span> * Shorthand for {@link Ext.JSON#decode}
- * @param {String} json The JSON string
- * @param {Boolean} safe (optional) Whether to return null or throw an exception if the JSON is invalid.
- * @return {Object} The resulting object
* @member Ext
* @method decode
+ * @alias Ext.JSON#decode
*/
Ext.decode = Ext.JSON.decode;
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>