Ext.data.JsonP.Ext_JSON({"mixins":[],"code_type":"assignment","inheritable":false,"component":false,"meta":{},"mixedInto":[],"uses":[],"aliases":{},"parentMixins":[],"superclasses":[],"members":{"event":[],"property":[],"css_var":[],"method":[{"meta":{},"owner":"Ext.JSON","tagname":"method","name":"decode","id":"method-decode"},{"meta":{},"owner":"Ext.JSON","tagname":"method","name":"encode","id":"method-encode"},{"meta":{},"owner":"Ext.JSON","tagname":"method","name":"encodeDate","id":"method-encodeDate"},{"meta":{},"owner":"Ext.JSON","tagname":"method","name":"encodeString","id":"method-encodeString"},{"meta":{},"owner":"Ext.JSON","tagname":"method","name":"encodeValue","id":"method-encodeValue"}],"css_mixin":[],"cfg":[]},"tagname":"class","extends":null,"html":"

Files

Modified version of Douglas Crockford's JSON.js that doesn't\nmess with the Object prototype.

\n
Defined By

Methods

Ext.JSON
view source
( String json, [Boolean safe] ) : Object
Decodes (parses) a JSON string to an object. ...

Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws\na SyntaxError unless the safe option is set.

\n

Parameters

  • json : String

    The JSON string

    \n
  • safe : Boolean (optional)

    True to return null, false to throw an exception if the JSON is invalid.

    \n

    Defaults to: false

Returns

Encodes an Object, Array or other value. ...

Encodes an Object, Array or other value.

\n\n

If the environment's native JSON encoding is not being used (Ext.USE_NATIVE_JSON is not set,\nor the environment does not support it), then ExtJS's encoding will be used. This allows the developer\nto add a toJSON method to their classes which need serializing to return a valid JSON representation\nof the object.

\n

Parameters

  • o : Object

    The variable to encode

    \n

Returns

Encodes a Date. ...

Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal\nexpression. The returned value includes enclosing double quotation marks.

\n\n

The default return format is \"yyyy-mm-ddThh:mm:ss\".

\n\n

To override this:

\n\n
Ext.JSON.encodeDate = function(d) {\n    return Ext.Date.format(d, '\"Y-m-d\"');\n};\n
\n

Parameters

  • d : Date

    The Date to encode

    \n

Returns

  • String

    The string literal to use in a JSON string.

    \n
Encodes a String. ...

Encodes a String. This returns the actual string which is inserted into the JSON string as the literal\nexpression. The returned value includes enclosing double quotation marks.

\n\n

To override this:

\n\n
Ext.JSON.encodeString = function(s) {\n    return 'Foo' + s;\n};\n
\n

Parameters

  • s : String

    The String to encode

    \n

Returns

  • String

    The string literal to use in a JSON string.

    \n
The function which encode uses to encode all javascript values to their JSON representations\nwhen Ext.USE_NATIVE_JSON...

The function which encode uses to encode all javascript values to their JSON representations\nwhen Ext.USE_NATIVE_JSON is false.

\n\n

This is made public so that it can be replaced with a custom implementation.

\n

Parameters

  • o : Object

    Any javascript value to be converted to its JSON representation

    \n

Returns

  • String

    The JSON representation of the passed value.

    \n
","subclasses":[],"name":"Ext.JSON","alternateClassNames":[],"inheritdoc":null,"files":[{"href":"JSON.html#Ext-JSON","filename":"JSON.js"}],"html_meta":{},"singleton":true,"id":"class-Ext.JSON","statics":{"property":[],"event":[],"css_var":[],"method":[],"css_mixin":[],"cfg":[]},"requires":[]});