Ext.data.JsonP.Ext_Object({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":null,"uses":[],"html":"

Files

A collection of useful static methods to deal with objects.

\n
Defined By

Methods

Ext.Object
view source
( object )
Returns a new object with the given object as the prototype chain. ...

Returns a new object with the given object as the prototype chain. This method is\ndesigned to mimic the ECMA standard Object.create method and is assigned to that\nfunction when it is available.

\n\n

NOTE This method does not support the property definitions capability of the\nObject.create method. Only the first argument is supported.

\n

Parameters

  • object : Object

    The prototype chain for the new object.

    \n
Ext.Object
view source
( object )private
...
\n

Parameters

Ext.Object
view source
( object, fn, [scope] )
Iterates through an object and invokes the given callback function for each iteration. ...

Iterates through an object and invokes the given callback function for each iteration.\nThe iteration can be stopped by returning false in the callback function. For example:

\n\n
var person = {\n    name: 'Jacky'\n    hairColor: 'black'\n    loves: ['food', 'sleeping', 'wife']\n};\n\nExt.Object.each(person, function(key, value, myself) {\n    console.log(key + \":\" + value);\n\n    if (key === 'hairColor') {\n        return false; // stop the iteration\n    }\n});\n
\n

Parameters

  • object : Object

    The object to iterate

    \n
  • fn : Function

    The callback function.

    \n

    Parameters

  • scope : Object (optional)

    The execution scope (this) of the callback function

    \n
Ext.Object
view source
( object1, object2 ) : Boolean
Shallow compares the contents of 2 objects using strict equality. ...

Shallow compares the contents of 2 objects using strict equality. Objects are\nconsidered equal if they both have the same set of properties and the\nvalue for those properties equals the other in the corresponding object.

\n\n
// Returns true\nExt.Object.equals({\n    foo: 1,\n    bar: 2\n}, {\n    foo: 1,\n    bar: 2\n});\n
\n

Parameters

Returns

  • Boolean

    true if the objects are equal.

    \n
Ext.Object
view source
( queryString, [recursive] ) : Object
Converts a query string back into an object. ...

Converts a query string back into an object.

\n\n

Non-recursive:

\n\n
Ext.Object.fromQueryString(\"foo=1&bar=2\"); // returns {foo: '1', bar: '2'}\nExt.Object.fromQueryString(\"foo=&bar=2\"); // returns {foo: null, bar: '2'}\nExt.Object.fromQueryString(\"some%20price=%24300\"); // returns {'some price': '$300'}\nExt.Object.fromQueryString(\"colors=red&colors=green&colors=blue\"); // returns {colors: ['red', 'green', 'blue']}\n
\n\n

Recursive:

\n\n
Ext.Object.fromQueryString(\n    \"username=Jacky&\"+\n    \"dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&\"+\n    \"hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&\"+\n    \"hobbies[3][0]=nested&hobbies[3][1]=stuff\", true);\n\n// returns\n{\n    username: 'Jacky',\n    dateOfBirth: {\n        day: '1',\n        month: '2',\n        year: '1911'\n    },\n    hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]\n}\n
\n

Parameters

  • queryString : String

    The query string to decode

    \n
  • recursive : Boolean (optional)

    Whether or not to recursively decode the string. This format is supported by\nPHP / Ruby on Rails servers and similar.

    \n

    Defaults to: false

Returns

Ext.Object
view source
( object, value )
Returns the first matching key corresponding to the given value. ...

Returns the first matching key corresponding to the given value.\nIf no matching value is found, null is returned.

\n\n
var person = {\n    name: 'Jacky',\n    loves: 'food'\n};\n\nalert(Ext.Object.getKey(person, 'food')); // alerts 'loves'\n
\n

Parameters

Ext.Object
view source
( object ) : String[]
Gets all keys of the given object as an array. ...

Gets all keys of the given object as an array.

\n\n
var values = Ext.Object.getKeys({\n    name: 'Jacky',\n    loves: 'food'\n}); // ['name', 'loves']\n
\n

Parameters

Returns

  • String[]

    An array of keys from the object

    \n
Ext.Object
view source
( object ) : Number
Gets the total number of this object's own properties\n\nvar size = Ext.Object.getSize({\n name: 'Jacky',\n loves: ...

Gets the total number of this object's own properties

\n\n
var size = Ext.Object.getSize({\n    name: 'Jacky',\n    loves: 'food'\n}); // size equals 2\n
\n

Parameters

Returns

Ext.Object
view source
( object ) : Array
Gets all values of the given object as an array. ...

Gets all values of the given object as an array.

\n\n
var values = Ext.Object.getValues({\n    name: 'Jacky',\n    loves: 'food'\n}); // ['Jacky', 'food']\n
\n

Parameters

Returns

  • Array

    An array of values from the object

    \n
Ext.Object
view source
( object ) : Boolean
Checks if there are any properties on this object. ...

Checks if there are any properties on this object.

\n

Parameters

Returns

  • Boolean

    true if there no properties on the object.

    \n
Ext.Object
view source
( destination, object ) : Object
Merges any number of objects recursively without referencing them or their children. ...

Merges any number of objects recursively without referencing them or their children.

\n\n
var extjs = {\n    companyName: 'Ext JS',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer'],\n    isSuperCool: true,\n    office: {\n        size: 2000,\n        location: 'Palo Alto',\n        isFun: true\n    }\n};\n\nvar newStuff = {\n    companyName: 'Sencha Inc.',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],\n    office: {\n        size: 40000,\n        location: 'Redwood City'\n    }\n};\n\nvar sencha = Ext.Object.merge(extjs, newStuff);\n\n// extjs and sencha then equals to\n{\n    companyName: 'Sencha Inc.',\n    products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],\n    isSuperCool: true,\n    office: {\n        size: 40000,\n        location: 'Redwood City',\n        isFun: true\n    }\n}\n
\n

Parameters

  • destination : Object

    The object into which all subsequent objects are merged.

    \n
  • object : Object...

    Any number of objects to merge into the destination.

    \n

Returns

  • Object

    merged The destination object with all passed objects merged in.

    \n
Ext.Object
view source
( destination )private
...
\n

Parameters

Ext.Object
view source
( name, value, [recursive] ) : Array
Converts a name - value pair to an array of objects with support for nested structures. ...

Converts a name - value pair to an array of objects with support for nested structures. Useful to construct\nquery strings. For example:

\n\n
var objects = Ext.Object.toQueryObjects('hobbies', ['reading', 'cooking', 'swimming']);\n\n// objects then equals:\n[\n    { name: 'hobbies', value: 'reading' },\n    { name: 'hobbies', value: 'cooking' },\n    { name: 'hobbies', value: 'swimming' },\n];\n\nvar objects = Ext.Object.toQueryObjects('dateOfBirth', {\n    day: 3,\n    month: 8,\n    year: 1987,\n    extra: {\n        hour: 4\n        minute: 30\n    }\n}, true); // Recursive\n\n// objects then equals:\n[\n    { name: 'dateOfBirth[day]', value: 3 },\n    { name: 'dateOfBirth[month]', value: 8 },\n    { name: 'dateOfBirth[year]', value: 1987 },\n    { name: 'dateOfBirth[extra][hour]', value: 4 },\n    { name: 'dateOfBirth[extra][minute]', value: 30 },\n];\n
\n

Parameters

  • name : String
    \n
  • value : Object/Array
    \n
  • recursive : Boolean (optional)

    True to traverse object recursively

    \n

    Defaults to: false

Returns

Ext.Object
view source
( object, [recursive] ) : String
Takes an object and converts it to an encoded query string. ...

Takes an object and converts it to an encoded query string.

\n\n

Non-recursive:

\n\n
Ext.Object.toQueryString({foo: 1, bar: 2}); // returns \"foo=1&bar=2\"\nExt.Object.toQueryString({foo: null, bar: 2}); // returns \"foo=&bar=2\"\nExt.Object.toQueryString({'some price': '$300'}); // returns \"some%20price=%24300\"\nExt.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns \"date=%222011-01-01T00%3A00%3A00%22\"\nExt.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns \"colors=red&colors=green&colors=blue\"\n
\n\n

Recursive:

\n\n
Ext.Object.toQueryString({\n    username: 'Jacky',\n    dateOfBirth: {\n        day: 1,\n        month: 2,\n        year: 1911\n    },\n    hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]\n}, true); // returns the following string (broken down and url-decoded for ease of reading purpose):\n// username=Jacky\n//    &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911\n//    &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff\n
\n

Parameters

  • object : Object

    The object to encode

    \n
  • recursive : Boolean (optional)

    Whether or not to interpret the object in recursive format.\n(PHP / Ruby on Rails servers and similar).

    \n

    Defaults to: false

Returns

","superclasses":[],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"Object2.html#Ext-Object","filename":"Object.js"}],"linenr":5,"members":{"property":[],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.Object","meta":{},"name":"chain","id":"method-chain"},{"tagname":"method","owner":"Ext.Object","meta":{"private":true},"name":"classify","id":"method-classify"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"each","id":"method-each"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"equals","id":"method-equals"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"fromQueryString","id":"method-fromQueryString"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"getKey","id":"method-getKey"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"getKeys","id":"method-getKeys"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"getSize","id":"method-getSize"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"getValues","id":"method-getValues"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"isEmpty","id":"method-isEmpty"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"merge","id":"method-merge"},{"tagname":"method","owner":"Ext.Object","meta":{"private":true},"name":"mergeIf","id":"method-mergeIf"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"toQueryObjects","id":"method-toQueryObjects"},{"tagname":"method","owner":"Ext.Object","meta":{},"name":"toQueryString","id":"method-toQueryString"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.Object","singleton":true,"override":null,"inheritdoc":null,"id":"class-Ext.Object","mixins":[],"mixedInto":[]});