X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.Array.js diff --git a/docs/output/Ext.Array.js b/docs/output/Ext.Array.js index fe91fd3e..119ace85 100644 --- a/docs/output/Ext.Array.js +++ b/docs/output/Ext.Array.js @@ -1,852 +1 @@ -Ext.data.JsonP.Ext_Array({ - "tagname": "class", - "name": "Ext.Array", - "doc": "

A set of useful static methods to deal with arrays; provide missing methods for older browsers.

\n", - "extends": null, - "mixins": [ - - ], - "alternateClassNames": [ - - ], - "xtype": null, - "author": "Jacky Nguyen ", - "docauthor": "Jacky Nguyen ", - "singleton": true, - "private": false, - "cfg": [ - - ], - "method": [ - { - "tagname": "method", - "name": "clean", - "member": "Ext.Array", - "doc": "

Filter through an array and remove empty item as defined in Ext.isEmpty

\n\n

@see Ext.Array.filter

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

results

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 344, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-clean", - "shortDoc": "

Filter through an array and remove empty item as defined in Ext.isEmpty

\n\n

@see Ext.Array.filter

\n" - }, - { - "tagname": "method", - "name": "clone", - "member": "Ext.Array", - "doc": "

Clone a flat array without referencing the previous one. Note that this is different\nfrom Ext.clone since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method\nfor Array.prototype.slice.call(array)

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

The clone array

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 477, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-clone", - "shortDoc": "Clone a flat array without referencing the previous one. Note that this is different\nfrom Ext.clone since it doesn't ..." - }, - { - "tagname": "method", - "name": "contains", - "member": "Ext.Array", - "doc": "

Checks whether or not the given array contains the specified item

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array to check

\n", - "optional": false - }, - { - "type": "Mixed", - "name": "item", - "doc": "

The item to look for

\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "

True if the array contains the item, false otherwise

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 161, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-contains", - "shortDoc": "

Checks whether or not the given array contains the specified item

\n" - }, - { - "tagname": "method", - "name": "difference", - "member": "Ext.Array", - "doc": "

Perform a set difference A-B by subtracting all items in array B from array A.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

A

\n", - "optional": false - }, - { - "type": "Array", - "name": "array", - "doc": "

B

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

difference

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 556, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-difference", - "shortDoc": "

Perform a set difference A-B by subtracting all items in array B from array A.

\n" - }, - { - "tagname": "method", - "name": "each", - "member": "Ext.Array", - "doc": "

Iterates an array or an iterable value and invoke the given callback function for each item.

\n\n
var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];\n\nExt.Array.each(countries, function(name, index, countriesItSelf) {\n    console.log(name);\n});\n\nvar sum = function() {\n    var sum = 0;\n\n    Ext.Array.each(arguments, function(value) {\n        sum += value;\n    });\n\n    return sum;\n};\n\nsum(1, 2, 3); // returns 6\n
\n\n

The iteration can be stopped by returning false in the function callback.

\n\n
Ext.Array.each(countries, function(name, index, countriesItSelf) {\n    if (name === 'Singapore') {\n        return false; // break here\n    }\n});\n
\n", - "params": [ - { - "type": "Array/NodeList/Mixed", - "name": "iterable", - "doc": "

The value to be iterated. If this\nargument is not iterable, the callback function is called once.

\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

The callback function. If it returns false, the iteration stops and this method returns\nthe current index. Arguments passed to this callback function are:

\n\n\n\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

(Optional) The scope (this reference) in which the specified function is executed.

\n", - "optional": false - }, - { - "type": "Boolean", - "name": "reverse", - "doc": "

(Optional) Reverse the iteration order (loop from the end to the beginning)\nDefaults false

\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "

See description for the fn parameter.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 37, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-each", - "shortDoc": "Iterates an array or an iterable value and invoke the given callback function for each item.\n\nvar countries = ['Vietn..." - }, - { - "tagname": "method", - "name": "every", - "member": "Ext.Array", - "doc": "

Executes the specified function for each array element until the function returns a falsy value.\nIf such an item is found, the function will return false immediately.\nOtherwise, it will return true.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

Callback function for each item

\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

Callback function scope

\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "

True if no false value is returned by the callback function.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 281, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-every", - "shortDoc": "Executes the specified function for each array element until the function returns a falsy value.\nIf such an item is f..." - }, - { - "tagname": "method", - "name": "filter", - "member": "Ext.Array", - "doc": "

Creates a new array with all of the elements of this array for which\nthe provided filtering function returns true.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

Callback function for each item

\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

Callback function scope

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

results

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 391, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-filter", - "shortDoc": "

Creates a new array with all of the elements of this array for which\nthe provided filtering function returns true.

\n" - }, - { - "tagname": "method", - "name": "flatten", - "member": "Ext.Array", - "doc": "

Recursively flattens into 1-d Array. Injects Arrays inline.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array to flatten

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

The new, flattened array.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 625, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-flatten", - "shortDoc": "

Recursively flattens into 1-d Array. Injects Arrays inline.

\n" - }, - { - "tagname": "method", - "name": "forEach", - "member": "Ext.Array", - "doc": "

Iterates an array and invoke the given callback function for each item. Note that this will simply\ndelegate to the native Array.prototype.forEach method if supported.\nIt doesn't support stopping the iteration by returning false in the callback function like\neach. However, performance could be much better in modern browsers comparing with\neach

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array to iterate

\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

The function callback, to be invoked these arguments:

\n\n\n\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

(Optional) The execution scope (this) in which the specified function is executed.

\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 105, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-forEach", - "shortDoc": "Iterates an array and invoke the given callback function for each item. Note that this will simply\ndelegate to the na..." - }, - { - "tagname": "method", - "name": "from", - "member": "Ext.Array", - "doc": "

Converts a value to an array if it's not already an array; returns:

\n\n\n\n", - "params": [ - { - "type": "Array/Mixed", - "name": "value", - "doc": "

The value to convert to an array if it's not already is an array

\n", - "optional": false - }, - { - "type": "Boolean", - "name": "newReference", - "doc": "

(Optional) newReference True to clone the given array and return a new reference if necessary,\ndefaults to false

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

array

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 417, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-from", - "shortDoc": "Converts a value to an array if it's not already an array; returns:\n\n\nAn empty array if given value is undefined or n..." - }, - { - "tagname": "method", - "name": "include", - "member": "Ext.Array", - "doc": "

Push an item into the array only if the array doesn't contain it yet

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array

\n", - "optional": false - }, - { - "type": "Mixed", - "name": "item", - "doc": "

The item to include

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

The passed array itself

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 464, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-include", - "shortDoc": "

Push an item into the array only if the array doesn't contain it yet

\n" - }, - { - "tagname": "method", - "name": "indexOf", - "member": "Ext.Array", - "doc": "

Get the index of the provided item in the given array, a supplement for the\nmissing arrayPrototype.indexOf in Internet Explorer.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array to check

\n", - "optional": false - }, - { - "type": "Mixed", - "name": "item", - "doc": "

The item to look for

\n", - "optional": false - }, - { - "type": "Number", - "name": "from", - "doc": "

(Optional) The index at which to begin the search

\n", - "optional": false - } - ], - "return": { - "type": "Number", - "doc": "

The index of item in the array (or -1 if it is not found)

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 135, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-indexOf", - "shortDoc": "Get the index of the provided item in the given array, a supplement for the\nmissing arrayPrototype.indexOf in Interne..." - }, - { - "tagname": "method", - "name": "intersect", - "member": "Ext.Array", - "doc": "

Merge multiple arrays into one with unique items that exist in all of the arrays.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

,...

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

intersect

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 507, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-intersect", - "shortDoc": "

Merge multiple arrays into one with unique items that exist in all of the arrays.

\n" - }, - { - "tagname": "method", - "name": "map", - "member": "Ext.Array", - "doc": "

Creates a new array with the results of calling a provided function on every element in this array.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

Callback function for each item

\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

Callback function scope

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

results

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 258, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-map", - "shortDoc": "

Creates a new array with the results of calling a provided function on every element in this array.

\n" - }, - { - "tagname": "method", - "name": "max", - "member": "Ext.Array", - "doc": "

Returns the maximum value in the Array

\n", - "params": [ - { - "type": "Array|NodeList", - "name": "array", - "doc": "

The Array from which to select the maximum value.

\n", - "optional": false - }, - { - "type": "Function", - "name": "comparisonFn", - "doc": "

(optional) a function to perform the comparision which determines maximization.

\n\n
              If omitted the \">\" operator will be used. Note: gt = 1; eq = 0; lt = -1\n
\n", - "optional": true - } - ], - "return": { - "type": "Mixed", - "doc": "

maxValue The maximum value

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 681, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-max", - "shortDoc": "

Returns the maximum value in the Array

\n" - }, - { - "tagname": "method", - "name": "mean", - "member": "Ext.Array", - "doc": "

Calculates the mean of all items in the array

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The Array to calculate the mean value of.

\n", - "optional": false - } - ], - "return": { - "type": "Number", - "doc": "

The mean.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 710, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-mean", - "shortDoc": "

Calculates the mean of all items in the array

\n" - }, - { - "tagname": "method", - "name": "merge", - "member": "Ext.Array", - "doc": "

Merge multiple arrays into one with unique items. Alias to union.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

,...

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

merged

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 489, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-merge", - "shortDoc": "

Merge multiple arrays into one with unique items. Alias to union.

\n" - }, - { - "tagname": "method", - "name": "min", - "member": "Ext.Array", - "doc": "

Returns the minimum value in the Array.

\n", - "params": [ - { - "type": "Array|NodeList", - "name": "array", - "doc": "

The Array from which to select the minimum value.

\n", - "optional": false - }, - { - "type": "Function", - "name": "comparisonFn", - "doc": "

(optional) a function to perform the comparision which determines minimization.

\n\n
              If omitted the \"<\" operator will be used. Note: gt = 1; eq = 0; lt = -1\n
\n", - "optional": true - } - ], - "return": { - "type": "Mixed", - "doc": "

minValue The minimum value

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 652, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-min", - "shortDoc": "

Returns the minimum value in the Array.

\n" - }, - { - "tagname": "method", - "name": "pluck", - "member": "Ext.Array", - "doc": "

Plucks the value of a property from each item in the Array. Example:

\n\n
Ext.Array.pluck(Ext.query(\"p\"), \"className\"); // [el1.className, el2.className, ..., elN.className]\n
\n", - "params": [ - { - "type": "Array|NodeList", - "name": "array", - "doc": "

The Array of items to pluck the value from.

\n", - "optional": false - }, - { - "type": "String", - "name": "propertyName", - "doc": "

The property name to pluck from each element.

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

The value from each item in the Array.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 236, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-pluck", - "shortDoc": "Plucks the value of a property from each item in the Array. Example:\n\nExt.Array.pluck(Ext.query(\"p\"), \"className\"); /..." - }, - { - "tagname": "method", - "name": "remove", - "member": "Ext.Array", - "doc": "

Removes the specified item from the array if it exists

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array

\n", - "optional": false - }, - { - "type": "Mixed", - "name": "item", - "doc": "

The item to remove

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

The passed array itself

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 447, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-remove", - "shortDoc": "

Removes the specified item from the array if it exists

\n" - }, - { - "tagname": "method", - "name": "some", - "member": "Ext.Array", - "doc": "

Executes the specified function for each array element until the function returns a truthy value.\nIf such an item is found, the function will return true immediately. Otherwise, it will return false.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "

Callback function for each item

\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "

Callback function scope

\n", - "optional": false - } - ], - "return": { - "type": "Boolean", - "doc": "

True if the callback function returns a truthy value.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 313, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-some", - "shortDoc": "Executes the specified function for each array element until the function returns a truthy value.\nIf such an item is ..." - }, - { - "tagname": "method", - "name": "sort", - "member": "Ext.Array", - "doc": "

Sorts the elements of an Array.\nBy default, this method sorts the elements alphabetically and ascending.

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The array to sort.

\n", - "optional": false - }, - { - "type": "Function", - "name": "sortFn", - "doc": "

(optional) The comparison function.

\n", - "optional": true - } - ], - "return": { - "type": "Array", - "doc": "

The sorted array.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 581, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-sort", - "shortDoc": "

Sorts the elements of an Array.\nBy default, this method sorts the elements alphabetically and ascending.

\n" - }, - { - "tagname": "method", - "name": "sum", - "member": "Ext.Array", - "doc": "

Calculates the sum of all items in the given array

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "

The Array to calculate the sum value of.

\n", - "optional": false - } - ], - "return": { - "type": "Number", - "doc": "

The sum.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 719, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-sum", - "shortDoc": "

Calculates the sum of all items in the given array

\n" - }, - { - "tagname": "method", - "name": "toArray", - "member": "Ext.Array", - "doc": "

Converts any iterable (numeric indices and a length property) into a true array.

\n\n

function test() {

\n\n
var args = Ext.Array.toArray(arguments),\n    fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);\n\nalert(args.join(' '));\nalert(fromSecondToLastArgs.join(' '));\n
\n\n

}

\n\n

test('just', 'testing', 'here'); // alerts 'just testing here';

\n\n
                             // alerts 'testing here';\n
\n\n

Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array\nExt.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']\nExt.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l', 'i']

\n", - "params": [ - { - "type": "Mixed", - "name": "iterable", - "doc": "

the iterable object to be turned into a true Array.

\n", - "optional": false - }, - { - "type": "Number", - "name": "start", - "doc": "

(Optional) a zero-based index that specifies the start of extraction. Defaults to 0

\n", - "optional": false - }, - { - "type": "Number", - "name": "end", - "doc": "

(Optional) a zero-based index that specifies the end of extraction. Defaults to the last\nindex of the iterable value

\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

array

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 185, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-toArray", - "shortDoc": "Converts any iterable (numeric indices and a length property) into a true array.\n\nfunction test() {\n\nvar args = Ext.A..." - }, - { - "tagname": "method", - "name": "union", - "member": "Ext.Array", - "doc": "

Alias to merge.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 746, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-union", - "shortDoc": "

Alias to merge.

\n" - }, - { - "tagname": "method", - "name": "unique", - "member": "Ext.Array", - "doc": "

Returns a new array with unique items

\n", - "params": [ - { - "type": "Array", - "name": "array", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "Array", - "doc": "

results

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 368, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array-method-unique", - "shortDoc": "

Returns a new array with unique items

\n" - } - ], - "property": [ - - ], - "event": [ - - ], - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/Array.js", - "linenr": 1, - "html_filename": "Array2.html", - "href": "Array2.html#Ext-Array", - "cssVar": [ - - ], - "cssMixin": [ - - ], - "component": false, - "superclasses": [ - - ], - "subclasses": [ - - ], - "mixedInto": [ - - ], - "allMixins": [ - - ] -}); \ No newline at end of file +Ext.data.JsonP.Ext_Array({"tagname":"class","html":"

Files

A set of useful static methods to deal with arrays; provide missing methods for older browsers.

\n
Defined By

Properties

Returns a shallow copy of a part of an array. ...

Returns a shallow copy of a part of an array. This is equivalent to the native\ncall \"Array.prototype.slice.call(array, begin, end)\". This is often used when \"array\"\nis \"arguments\" since the arguments object does not supply a slice method but can\nbe the context object to Array.prototype.slice.

\n
Defined By

Methods

Filter through an array and remove empty item as defined in Ext.isEmpty\n\nSee filter ...

Filter through an array and remove empty item as defined in Ext.isEmpty

\n\n

See filter

\n

Parameters

Returns

Clone a flat array without referencing the previous one. ...

Clone a flat array without referencing the previous one. Note that this is different\nfrom Ext.clone since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method\nfor Array.prototype.slice.call(array)

\n

Parameters

Returns

Checks whether or not the given array contains the specified item ...

Checks whether or not the given array contains the specified item

\n

Parameters

  • array : Array

    The array to check

    \n
  • item : Object

    The item to look for

    \n

Returns

  • Boolean

    True if the array contains the item, false otherwise

    \n
Perform a set difference A-B by subtracting all items in array B from array A. ...

Perform a set difference A-B by subtracting all items in array B from array A.

\n

Parameters

Returns

( Array/NodeList/Object iterable, Function fn, [Object scope], [Boolean reverse] ) : Boolean
Iterates an array or an iterable value and invoke the given callback function for each item. ...

Iterates an array or an iterable value and invoke the given callback function for each item.

\n\n
var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];\n\nExt.Array.each(countries, function(name, index, countriesItSelf) {\n    console.log(name);\n});\n\nvar sum = function() {\n    var sum = 0;\n\n    Ext.Array.each(arguments, function(value) {\n        sum += value;\n    });\n\n    return sum;\n};\n\nsum(1, 2, 3); // returns 6\n
\n\n

The iteration can be stopped by returning false in the function callback.

\n\n
Ext.Array.each(countries, function(name, index, countriesItSelf) {\n    if (name === 'Singapore') {\n        return false; // break here\n    }\n});\n
\n\n

Ext.each is alias for Ext.Array.each

\n

Parameters

  • iterable : Array/NodeList/Object

    The value to be iterated. If this\nargument is not iterable, the callback function is called once.

    \n
  • fn : Function

    The callback function. If it returns false, the iteration stops and this method returns\nthe current index.

    \n

    Parameters

    • item : Object

      The item at the current index in the passed array

      \n
    • index : Number

      The current index within the array

      \n
    • allItems : Array

      The array itself which was passed as the first argument

      \n

    Returns

    • Boolean

      Return false to stop iteration.

      \n
  • scope : Object (optional)

    The scope (this reference) in which the specified function is executed.

    \n
  • reverse : Boolean (optional)

    Reverse the iteration order (loop from the end to the beginning)\nDefaults false

    \n

Returns

  • Boolean

    See description for the fn parameter.

    \n
( Array array, Number index, Number removeCount ) : Array
Removes items from an array. ...

Removes items from an array. This is functionally equivalent to the splice method\nof Array, but works around bugs in IE8's splice method and does not copy the\nremoved elements in order to return them (because very often they are ignored).

\n

Parameters

  • array : Array

    The Array on which to replace.

    \n
  • index : Number

    The index in the array at which to operate.

    \n
  • removeCount : Number

    The number of items to remove at index.

    \n

Returns

Executes the specified function for each array element until the function returns a falsy value. ...

Executes the specified function for each array element until the function returns a falsy value.\nIf such an item is found, the function will return false immediately.\nOtherwise, it will return true.

\n

Parameters

  • array : Array
    \n
  • fn : Function

    Callback function for each item

    \n
  • scope : Object

    Callback function scope

    \n

Returns

  • Boolean

    True if no false value is returned by the callback function.

    \n
Creates a new array with all of the elements of this array for which\nthe provided filtering function returns true. ...

Creates a new array with all of the elements of this array for which\nthe provided filtering function returns true.

\n

Parameters

  • array : Array
    \n
  • fn : Function

    Callback function for each item

    \n
  • scope : Object

    Callback function scope

    \n

Returns

Recursively flattens into 1-d Array. ...

Recursively flattens into 1-d Array. Injects Arrays inline.

\n

Parameters

  • array : Array

    The array to flatten

    \n

Returns

Iterates an array and invoke the given callback function for each item. ...

Iterates an array and invoke the given callback function for each item. Note that this will simply\ndelegate to the native Array.prototype.forEach method if supported. It doesn't support stopping the\niteration by returning false in the callback function like each. However, performance\ncould be much better in modern browsers comparing with each

\n

Parameters

  • array : Array

    The array to iterate

    \n
  • fn : Function

    The callback function.

    \n

    Parameters

    • item : Object

      The item at the current index in the passed array

      \n
    • index : Number

      The current index within the array

      \n
    • allItems : Array

      The array itself which was passed as the first argument

      \n
  • scope : Object (optional)

    The execution scope (this) in which the specified function is executed.

    \n
( Object value, [Boolean newReference] ) : Array
Converts a value to an array if it's not already an array; returns:\n\n\nAn empty array if given value is undefined or n...

Converts a value to an array if it's not already an array; returns:

\n\n
    \n
  • An empty array if given value is undefined or null
  • \n
  • Itself if given value is already an array
  • \n
  • An array copy if given value is iterable (arguments, NodeList and alike)
  • \n
  • An array with one item which is the given value, otherwise
  • \n
\n\n

Parameters

  • value : Object

    The value to convert to an array if it's not already is an array

    \n
  • newReference : Boolean (optional)

    True to clone the given array and return a new reference if necessary,\ndefaults to false

    \n

Returns

Push an item into the array only if the array doesn't contain it yet ...

Push an item into the array only if the array doesn't contain it yet

\n

Parameters

  • array : Array

    The array

    \n
  • item : Object

    The item to include

    \n
Get the index of the provided item in the given array, a supplement for the\nmissing arrayPrototype.indexOf in Interne...

Get the index of the provided item in the given array, a supplement for the\nmissing arrayPrototype.indexOf in Internet Explorer.

\n

Parameters

  • array : Array

    The array to check

    \n
  • item : Object

    The item to look for

    \n
  • from : Number (optional)

    The index at which to begin the search

    \n

Returns

  • Number

    The index of item in the array (or -1 if it is not found)

    \n
Inserts items in to an array. ...

Inserts items in to an array.

\n

Parameters

  • array : Array

    The Array on which to replace.

    \n
  • index : Number

    The index in the array at which to operate.

    \n
  • items : Array

    The array of items to insert at index.

    \n

Returns

Merge multiple arrays into one with unique items that exist in all of the arrays. ...

Merge multiple arrays into one with unique items that exist in all of the arrays.

\n

Parameters

Returns

Creates a new array with the results of calling a provided function on every element in this array. ...

Creates a new array with the results of calling a provided function on every element in this array.

\n

Parameters

  • array : Array
    \n
  • fn : Function

    Callback function for each item

    \n
  • scope : Object

    Callback function scope

    \n

Returns

( Array/NodeList array, [Function comparisonFn] ) : Object
Returns the maximum value in the Array. ...

Returns the maximum value in the Array.

\n

Parameters

  • array : Array/NodeList

    The Array from which to select the maximum value.

    \n
  • comparisonFn : Function (optional)

    a function to perform the comparision which determines maximization.\nIf omitted the \">\" operator will be used. Note: gt = 1; eq = 0; lt = -1

    \n

Returns

  • Object

    maxValue The maximum value

    \n
Calculates the mean of all items in the array. ...

Calculates the mean of all items in the array.

\n

Parameters

  • array : Array

    The Array to calculate the mean value of.

    \n

Returns

Merge multiple arrays into one with unique items. ...

Merge multiple arrays into one with unique items.

\n\n

union is alias for merge

\n

Parameters

Returns

( Array/NodeList array, [Function comparisonFn] ) : Object
Returns the minimum value in the Array. ...

Returns the minimum value in the Array.

\n

Parameters

  • array : Array/NodeList

    The Array from which to select the minimum value.

    \n
  • comparisonFn : Function (optional)

    a function to perform the comparision which determines minimization.\nIf omitted the \"<\" operator will be used. Note: gt = 1; eq = 0; lt = -1

    \n

Returns

  • Object

    minValue The minimum value

    \n
( Array/NodeList array, String propertyName ) : Array
Plucks the value of a property from each item in the Array. ...

Plucks the value of a property from each item in the Array. Example:

\n\n
Ext.Array.pluck(Ext.query(\"p\"), \"className\"); // [el1.className, el2.className, ..., elN.className]\n
\n

Parameters

  • array : Array/NodeList

    The Array of items to pluck the value from.

    \n
  • propertyName : String

    The property name to pluck from each element.

    \n

Returns

  • Array

    The value from each item in the Array.

    \n
Removes the specified item from the array if it exists ...

Removes the specified item from the array if it exists

\n

Parameters

  • array : Array

    The array

    \n
  • item : Object

    The item to remove

    \n

Returns

  • Array

    The passed array itself

    \n
( Array array, Number index, Number removeCount, [Array insert] ) : Array
Replaces items in an array. ...

Replaces items in an array. This is functionally equivalent to the splice method\nof Array, but works around bugs in IE8's splice method and is often more convenient\nto call because it accepts an array of items to insert rather than use a variadic\nargument list.

\n

Parameters

  • array : Array

    The Array on which to replace.

    \n
  • index : Number

    The index in the array at which to operate.

    \n
  • removeCount : Number

    The number of items to remove at index (can be 0).

    \n
  • insert : Array (optional)

    An array of items to insert at index.

    \n

Returns

Executes the specified function for each array element until the function returns a truthy value. ...

Executes the specified function for each array element until the function returns a truthy value.\nIf such an item is found, the function will return true immediately. Otherwise, it will return false.

\n

Parameters

  • array : Array
    \n
  • fn : Function

    Callback function for each item

    \n
  • scope : Object

    Callback function scope

    \n

Returns

  • Boolean

    True if the callback function returns a truthy value.

    \n
Sorts the elements of an Array. ...

Sorts the elements of an Array.\nBy default, this method sorts the elements alphabetically and ascending.

\n

Parameters

  • array : Array

    The array to sort.

    \n
  • sortFn : Function (optional)

    The comparison function.

    \n

Returns

( Array array, Number index, Number removeCount ) : Array
Replaces items in an array. ...

Replaces items in an array. This is equivalent to the splice method of Array, but\nworks around bugs in IE8's splice method. The signature is exactly the same as the\nsplice method except that the array is the first argument. All arguments following\nremoveCount are inserted in the array at index.

\n

Parameters

  • array : Array

    The Array on which to replace.

    \n
  • index : Number

    The index in the array at which to operate.

    \n
  • removeCount : Number

    The number of items to remove at index (can be 0).

    \n

Returns

  • Array

    An array containing the removed items.

    \n
Calculates the sum of all items in the given array. ...

Calculates the sum of all items in the given array.

\n

Parameters

  • array : Array

    The Array to calculate the sum value of.

    \n

Returns

( Object iterable, [Number start], [Number end] ) : Array
Converts any iterable (numeric indices and a length property) into a true array. ...

Converts any iterable (numeric indices and a length property) into a true array.

\n\n
function test() {\n    var args = Ext.Array.toArray(arguments),\n        fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);\n\n    alert(args.join(' '));\n    alert(fromSecondToLastArgs.join(' '));\n}\n\ntest('just', 'testing', 'here'); // alerts 'just testing here';\n                                 // alerts 'testing here';\n\nExt.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array\nExt.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']\nExt.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l', 'i']\n
\n\n

Ext.toArray is alias for Ext.Array.toArray

\n

Parameters

  • iterable : Object

    the iterable object to be turned into a true Array.

    \n
  • start : Number (optional)

    a zero-based index that specifies the start of extraction. Defaults to 0

    \n
  • end : Number (optional)

    a zero-based index that specifies the end of extraction. Defaults to the last\nindex of the iterable value

    \n

Returns

Merge multiple arrays into one with unique items. ...

Merge multiple arrays into one with unique items.

\n\n

union is alias for merge

\n

Parameters

Returns

Returns a new array with unique items ...

Returns a new array with unique items

\n

Parameters

Returns

","allMixins":[],"meta":{"author":["Jacky Nguyen "],"docauthor":["Jacky Nguyen "]},"requires":[],"deprecated":null,"extends":null,"inheritable":false,"static":false,"superclasses":[],"singleton":true,"code_type":"nop","alias":null,"statics":{"property":[],"css_var":[],"css_mixin":[],"cfg":[],"method":[],"event":[]},"subclasses":[],"uses":[],"protected":false,"mixins":[],"members":{"property":[{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.Array","template":null,"required":null,"protected":false,"name":"slice","id":"property-slice"}],"css_var":[],"css_mixin":[],"cfg":[],"method":[{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"clean","id":"method-clean"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"clone","id":"method-clone"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"contains","id":"method-contains"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"difference","id":"method-difference"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"each","id":"method-each"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"erase","id":"method-erase"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"every","id":"method-every"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"filter","id":"method-filter"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"flatten","id":"method-flatten"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"forEach","id":"method-forEach"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"from","id":"method-from"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"include","id":"method-include"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"indexOf","id":"method-indexOf"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"insert","id":"method-insert"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"intersect","id":"method-intersect"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"map","id":"method-map"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"max","id":"method-max"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"mean","id":"method-mean"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"merge","id":"method-merge"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"min","id":"method-min"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"pluck","id":"method-pluck"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"remove","id":"method-remove"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"replace","id":"method-replace"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"some","id":"method-some"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"sort","id":"method-sort"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"splice","id":"method-splice"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"sum","id":"method-sum"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"toArray","id":"method-toArray"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"union","id":"method-union"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.Array","template":false,"required":null,"protected":false,"name":"unique","id":"method-unique"}],"event":[]},"private":false,"component":false,"name":"Ext.Array","alternateClassNames":[],"id":"class-Ext.Array","mixedInto":[],"xtypes":{},"files":[{"href":"Array3.html#Ext-Array","filename":"Array.js"}]}); \ No newline at end of file