Sencha Documentation

Extsingleton

The Ext namespace (global object) encapsulates all classes, singletons, and utility methods provided by Sencha's libraries.

Most user interface Components are at a lower level of nesting in the namespace, but many common utility functions are provided as direct properties of the Ext namespace.

Also many frequently used methods from other classes are provided as shortcuts within the Ext namespace. For example Ext.getCmp aliases Ext.ComponentMgr.get.

Many applications are initiated with Ext.onReady which is called once the DOM is ready. This ensures all scripts have been loaded, preventing dependency issues. For example

 Ext.onReady(function(){
     new Ext.Component({
         renderTo: document.body,
         html: 'DOM ready!'
     });
 });

For more information about how to use the Ext classes, see The Learning Center The FAQ The forums

Defined By

Properties

 
URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. In older versions o...
URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. For other browsers it uses an inline data URL.
 
URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent the IE insecure content...
URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent the IE insecure content warning ('about:blank', except for IE in secure mode, which is 'javascript:""').
 
Indicates whether to use native browser parsing for JSON methods. This option is ignored if the browser does not supp...
Indicates whether to use native browser parsing for JSON methods. This option is ignored if the browser does not support native JSON methods. Note: Native JSON methods will not work with objects that have functions. Also, property names must be quoted, otherwise the data will not parse. (Defaults to false)
 
True if the Ext.fx.Anim Class is available
True if the Ext.fx.Anim Class is available
 
True to automatically uncache orphaned Ext.core.Elements periodically (defaults to true)
True to automatically uncache orphaned Ext.core.Elements periodically (defaults to true)
 
True to automatically purge event listeners during garbageCollection (defaults to true).
True to automatically purge event listeners during garbageCollection (defaults to true).
 
EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. Currently not optimized...
EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. Currently not optimized for performance.
 
Put it into Ext namespace so that we can reuse outside this
Put it into Ext namespace so that we can reuse outside this
 
True if the detected platform is Adobe Air.
True if the detected platform is Adobe Air.
 
True if the detected browser is Chrome.
True if the detected browser is Chrome.
 
True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
 
True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
 
True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
 
True if the detected browser is Internet Explorer.
True if the detected browser is Internet Explorer.
 
True if the detected browser is Internet Explorer 6.x.
True if the detected browser is Internet Explorer 6.x.
 
True if the detected browser is Internet Explorer 7.x.
True if the detected browser is Internet Explorer 7.x.
 
True if the detected browser is Internet Explorer 8.x.
True if the detected browser is Internet Explorer 8.x.
 
True if the detected browser is Internet Explorer 9.x.
True if the detected browser is Internet Explorer 9.x.
 
True if the detected platform is Linux.
True if the detected platform is Linux.
 
True if the detected platform is Mac OS.
True if the detected platform is Mac OS.
 
True if the detected browser is Opera.
True if the detected browser is Opera.
 
True when the document is fully initialized and ready for action
True when the document is fully initialized and ready for action
 
True if the detected browser is Safari.
True if the detected browser is Safari.
 
True if the detected browser is Safari 2.x.
True if the detected browser is Safari 2.x.
 
True if the detected browser is Safari 3.x.
True if the detected browser is Safari 3.x.
 
True if the detected browser is Safari 4.x.
True if the detected browser is Safari 4.x.
 
True if the detected browser uses WebKit.
True if the detected browser uses WebKit.
 
True if the detected platform is Windows.
True if the detected platform is Windows.
 
True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers with an additi...
True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers with an additional element. Also remember that when you turn on this option, you have to use ext-all-scoped { unless you use the bootstrap.js to load your javascript, in which case it will be handled for you.
 
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you may wa...
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you may want to set this to true.
Defined By

Methods

 
addBehaviors( Object obj) : Void
Applies event listeners to elements by selectors when the document is ready. The event name is specified with an &#64...
Applies event listeners to elements by selectors when the document is ready. The event name is specified with an @ suffix.
Ext.addBehaviors({
    // add a listener for click on all anchors in element with id foo
    '#foo a@click' : function(e, t){
        // do something
    },

    // add the same listener to multiple selectors (separated by comma BEFORE the @)
    '#foo a, #bar span.some-class@mouseover' : function(){
        // do something
    }
});

Parameters

  • obj : Object
    The list of behaviors to apply

Returns

  • Void
 
apply( Object object, Object config, Object defaults) : Object
Copies all the properties of config to the specified object. IMPORTANT: Note that it doesn't take care of recursive m...
Copies all the properties of config to the specified object. IMPORTANT: Note that it doesn't take care of recursive merging and cloning without referencing the original objects / arrays Use Ext.merge instead if you need that.

Parameters

  • object : Object
    The receiver of the properties
  • config : Object
    The source of the properties
  • defaults : Object
    A different object that will also be applied for default values

Returns

  • Object   returns obj
 
applyIf( Object object, Object config) : Object
Copies all the properties of config to object if they don't already exist.
Copies all the properties of config to object if they don't already exist.

Parameters

  • object : Object
    The receiver of the properties
  • config : Object
    The source of the properties

Returns

  • Object   returns obj
 
Shorthand for Ext.Function-bind
Shorthand for Ext.Function-bind

Returns

  • Void
 
callback( Function callback, [Object scope], [Array args], [Number delay]) : Void
Execute a callback function in a particular scope. If no function is passed the call is ignored.
Execute a callback function in a particular scope. If no function is passed the call is ignored.

Parameters

  • callback : Function
    The callback to execute
  • scope : Object
    (optional) The scope to execute in
  • args : Array
    (optional) The arguments to pass to the function
  • delay : Number
    (optional) Pass a number to delay the call by a number of milliseconds.

Returns

  • Void
 
clean( Array/NodeList arr) : Array
Creates a copy of the passed Array with falsy values removed.
Creates a copy of the passed Array with falsy values removed.

Parameters

  • arr : Array/NodeList
    The Array from which to remove falsy values.

Returns

  • Array   The new, compressed Array.
 
clone( Mixed item) : Mixed
Clone almost any type of variable including array, object, DOM nodes and Date without keeping the old reference
Clone almost any type of variable including array, object, DOM nodes and Date without keeping the old reference

Parameters

  • item : Mixed
    The variable to clone

Returns

  • Mixed   clone
 
copyTo( Object dest, Object source, Array/String names, [Boolean usePrototypeKeys]) : Object
Copies a set of named properties fom the source object to the destination object. example:ImageComponent = Ext.extend...
Copies a set of named properties fom the source object to the destination object.

example:

ImageComponent = Ext.extend(Ext.Component, {
    initComponent: function() {
        this.autoEl = { tag: 'img' };
        MyComponent.superclass.initComponent.apply(this, arguments);
        this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
    }
});

Parameters

  • dest : Object
    The destination object.
  • source : Object
    The source object.
  • names : Array/String
    Either an Array of property names, or a comma-delimited list of property names to copy.
  • usePrototypeKeys : Boolean
    (Optional) Defaults to false. Pass true to copy keys off of the prototype as well as the instance.

Returns

  • Object   The modified object.
 
Convenient shorthand, see Ext.ClassManager-instantiate
Convenient shorthand, see Ext.ClassManager-instantiate

Returns

  • Void
 
Convenient shorthand, see Ext.ClassManager-instantiateByAlias
Convenient shorthand, see Ext.ClassManager-instantiateByAlias

Returns

  • Void
 
createDelegate( Function fn, [Object scope], [Array args], [Boolean/Number appendArgs]) : Function
Shorthand for Ext.Function-createDelegate
Shorthand for Ext.Function-createDelegate

Parameters

  • fn : Function
    The function to delegate.
  • scope : Object
    (optional) The scope (this reference) in which the function is executed. If omitted, defaults to the browser window.
  • args : Array
    (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)
  • appendArgs : Boolean/Number
    (optional) if True args are appended to call args instead of overriding, if a number the args are inserted at the specified position

Returns

  • Function   The new function
 
createInterceptor( Function origFn, Function newFn, [Object scope]) : Function
Shorthand for Ext.Function-createInterceptor
Shorthand for Ext.Function-createInterceptor

Parameters

  • origFn : Function
    The original function.
  • newFn : Function
    The function to call before the original
  • scope : Object
    (optional) The scope (this reference) in which the passed function is executed. If omitted, defaults to the scope in which the original function is called or the browser window.

Returns

  • Function   The new function
 
createSequence( Function origFn, Function newFn, [Object scope]) : Function
Shorthand for Ext.Function-createSequence
Shorthand for Ext.Function-createSequence

Parameters

  • origFn : Function
    The original function.
  • newFn : Function
    The function to sequence
  • scope : Object
    (optional) The scope (this reference) in which the passed function is executed. If omitted, defaults to the scope in which the original function is called or the browser window.

Returns

  • Function   The new function
 
decode( String json, [Boolean safe]) : Object
Shorthand for Ext.JSON-decode
Shorthand for Ext.JSON-decode

Parameters

  • json : String
    The JSON string
  • safe : Boolean
    (optional) Whether to return null or throw an exception if the JSON is invalid.

Returns

  • Object   The resulting object
 
Shorthand for Ext.Function-defer
Shorthand for Ext.Function-defer

Returns

  • Void
 
Convenient shorthand for Ext.ClassManager-create, see detailed explanation
Convenient shorthand for Ext.ClassManager-create, see detailed explanation

Returns

  • Void
 
destroy( Mixed arg1, [Mixed arg2], [Mixed etc...]) : Void
Attempts to destroy any objects passed to it by removing all event listeners, removing them from the DOM (if applicab...
Attempts to destroy any objects passed to it by removing all event listeners, removing them from the DOM (if applicable) and calling their destroy functions (if available). This method is primarily intended for arguments of type Ext.core.Element and Ext.Component, but any subclass of Ext.util.Observable can be passed in. Any number of elements and/or components can be passed into this function in a single call as separate arguments.

Parameters

Returns

  • Void
 
destroyMembers( Object o, Mixed arg1, Mixed etc...) : Void
Attempts to destroy and then remove a set of named properties of the passed object.
Attempts to destroy and then remove a set of named properties of the passed object.

Parameters

  • o : Object
    The object (most likely a Component) who's properties you wish to destroy.
  • arg1 : Mixed
    The name of the property to destroy and remove from the object.
  • etc... : Mixed
    More property names to destroy and remove.

Returns

  • Void
 
Shorthand for Ext.Dispatcher-dispatch. Dispatches a request to a controller action
Shorthand for Ext.Dispatcher-dispatch. Dispatches a request to a controller action

Returns

  • Void
 
each( Object/Array object, Function fn, Object scope) : Void
Iterates either the elements in an array, or the properties in an object.
Iterates either the elements in an array, or the properties in an object.

Parameters

  • object : Object/Array
    The object or array to be iterated
  • fn : Function
    The function to be called for each iteration. The iteration will stop if the supplied function returns false, or all array elements / object properties have been covered. The signature varies depending on the type of object being interated:
    • Arrays : (Object item, Number index, Array allItems) When iterating an array, the supplied function is called with each item.
    • Objects : (String key, Object value, Object) When iterating an object, the supplied function is called with each key-value pair in the object, and the iterated object
  • scope : Object
    The scope (this reference) in which the specified function is executed. Defaults to the object being iterated.

Returns

  • Void
 
A reusable empty function
A reusable empty function

Returns

  • Void
 
encode( Mixed o) : String
Shorthand for Ext.JSON-encode
Shorthand for Ext.JSON-encode

Parameters

  • o : Mixed
    The variable to encode

Returns

  • String   The JSON string
 
escapeRe( String str) : String
Escapes the passed string for use in a regular expression
Escapes the passed string for use in a regular expression

Parameters

  • str : String

Returns

  • String
 
Convenient shortcut to Ext.Loader-exclude
Convenient shortcut to Ext.Loader-exclude

Returns

  • Void
 
extend( Function superclass, Object overrides) : Function
Since Core version 4 this method is meant to be used internally only. Use Ext.define instead.
Since Core version 4 this method is meant to be used internally only. Use Ext.define instead.

Parameters

  • superclass : Function
  • overrides : Object

Returns

  • Function   The subclass constructor from the overrides parameter, or a generated one if not provided.
 
flatten( Array arr) : Array
Recursively flattens into 1-d Array. Injects Arrays inline.
Recursively flattens into 1-d Array. Injects Arrays inline.

Parameters

  • arr : Array
    The array to flatten

Returns

  • Array   The new, flattened array.
 
fly( String/HTMLElement el, [String named]) : Element
Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to t...

Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element - the dom node can be overwritten by other code. Shorthand of Ext.core.Element-fly

Use this to make one-time references to DOM elements which are not going to be accessed again either by application code, or by Ext's classes. If accessing an element which will be processed regularly, then Ext.get will be more appropriate to take advantage of the caching provided by the Ext.core.Element class.

Parameters

  • el : String/HTMLElement
    The dom node or id
  • named : String
    (optional) Allows for creation of named reusable flyweights to prevent conflicts (e.g. internally Ext uses "_global")

Returns

  • Element   The shared Element object (or null if no matching element was found)
 
get( Mixed el) : Element
Retrieves Ext.core.Element objects. This method does not retrieve Components. This method retrieves Ext.core.Element ...
Retrieves Ext.core.Element objects.

This method does not retrieve Components. This method retrieves Ext.core.Element objects which encapsulate DOM elements. To retrieve a Component by its ID, use Ext.ComponentMgr-get.

Uses simple caching to consistently return the same object. Automatically fixes if an object was recreated with the same id via AJAX or DOM.

Shorthand of Ext.core.Element-get

Parameters

  • el : Mixed
    The id of the node, a DOM Node or an existing Element.

Returns

  • Element   The Element object (or null if no matching element was found)
 
getBody : Ext.core.Element
Returns the current document body as an Ext.core.Element.
Returns the current document body as an Ext.core.Element.

Returns

  • Ext.core.Element   The document body
 
Convenient shorthand, see Ext.ClassManager-getClass
Convenient shorthand, see Ext.ClassManager-getClass

Returns

  • Void
 
getCmp( String id) : Ext.Component
This is shorthand reference to Ext.ComponentMgr-get. Looks up an existing Component by id
This is shorthand reference to Ext.ComponentMgr-get. Looks up an existing Component by id

Parameters

  • id : String
    The component id

Returns

  • Ext.Component   The Component, undefined if not found, or null if a Class was found.
 
getDoc : Ext.core.Element
Returns the current HTML document object as an Ext.core.Element.
Returns the current HTML document object as an Ext.core.Element.

Returns

  • Ext.core.Element   The document
 
getDom( Mixed el) : HTMLElement
Return the dom node for the passed String (id), dom node, or Ext.core.Element. Optional 'strict' flag is needed for I...
Return the dom node for the passed String (id), dom node, or Ext.core.Element. Optional 'strict' flag is needed for IE since it can return 'name' and 'id' elements by using getElementById. Here are some examples:
// gets dom node based on id
var elDom = Ext.getDom('elId');
// gets dom node based on the dom node
var elDom1 = Ext.getDom(elDom);

// If we don't know if we are working with an
// Ext.core.Element or a dom node use Ext.getDom
function(el){
    var dom = Ext.getDom(el);
    // do something with the dom node
}
Note: the dom node to be found actually needs to exist (be rendered, etc) when this method is called to be successful.

Parameters

  • el : Mixed

Returns

  • HTMLElement
 
getHead : Ext.core.Element
Returns the current document head as an Ext.core.Element.
Returns the current document head as an Ext.core.Element.

Returns

  • Ext.core.Element   The document head
 
Returns the current orientation of the mobile device
Returns the current orientation of the mobile device

Returns

  • String   Either 'portrait' or 'landscape'
 
getScrollBarWidth( [Boolean force]) : Number
Utility method for getting the width of the browser scrollbar. This can differ depending on operating system settings...
Utility method for getting the width of the browser scrollbar. This can differ depending on operating system settings, such as the theme or font size.

Parameters

  • force : Boolean
    (optional) true to force a recalculation of the value.

Returns

  • Number   The width of the scrollbar.
 
getStore( String/Object id) : Ext.data.Store
Gets a registered Store by id (shortcut to lookup)
Gets a registered Store by id (shortcut to lookup)

Parameters

  • id : String/Object
    The id of the Store, or a Store instance

Returns

  • Ext.data.Store
 
htmlDecode( String value) : String
Convert certain characters (&, <, >, and ') from their HTML character equivalents.
Convert certain characters (&, <, >, and ') from their HTML character equivalents.

Parameters

  • value : String
    The string to decode

Returns

  • String   The decoded text
 
htmlEncode( String value) : String
Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.

Parameters

  • value : String
    The string to encode

Returns

  • String   The encoded text
 
id( [Mixed el], [String prefix]) : String
Generates unique ids. If the element already has an id, it is unchanged
Generates unique ids. If the element already has an id, it is unchanged

Parameters

  • el : Mixed
    (optional) The element to generate an id for
  • prefix : String
    (optional) Id prefix (defaults "ext-gen")

Returns

  • String   The generated Id.
 
invoke( Array|NodeList arr, String methodName, ...* args) : Array
Invokes a method on each item in an Array. // Example: Ext.invoke(Ext.query("p"), "getAttribute", "id"); // [el1.getA...
Invokes a method on each item in an Array.
// Example:
Ext.invoke(Ext.query("p"), "getAttribute", "id");
// [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]

Parameters

  • arr : Array|NodeList
    The Array of items to invoke the method on.
  • methodName : String
    The method name to invoke.
  • args : ...*
    Arguments to send into the method invocation.

Returns

  • Array   The results of invoking the method on each item in the array.
 
isArray( Mixed target) : Boolean
Returns true if the passed value is a JavaScript Array, false otherwise.
Returns true if the passed value is a JavaScript Array, false otherwise.

Parameters

  • target : Mixed
    The target to test

Returns

  • Boolean
 
isBoolean( Mixed value) : Boolean
Returns true if the passed value is a boolean.
Returns true if the passed value is a boolean.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isDate( Object object) : Boolean
Returns true if the passed value is a JavaScript Date object, false otherwise.
Returns true if the passed value is a JavaScript Date object, false otherwise.

Parameters

  • object : Object
    The object to test

Returns

  • Boolean
 
isDefined( Mixed value) : Boolean
Returns true if the passed value is defined.
Returns true if the passed value is defined.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isElement( Mixed value) : Boolean
Returns true if the passed value is an HTMLElement
Returns true if the passed value is an HTMLElement

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isEmpty( Mixed value, [Boolean allowBlank]) : Boolean
Returns true if the passed value is empty. The value is deemed to be empty if it is: null undefined an empty array a...
Returns true if the passed value is empty. The value is deemed to be empty if it is:
  • null
  • undefined
  • an empty array
  • a zero length string (Unless the allowBlank parameter is true)

Parameters

  • value : Mixed
    The value to test
  • allowBlank : Boolean
    (optional) true to allow empty strings (defaults to false)

Returns

  • Boolean
 
isFunction( Mixed value) : Boolean
Returns true if the passed value is a JavaScript Function, false otherwise.
Returns true if the passed value is a JavaScript Function, false otherwise.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isIterable( Mixed value) : Boolean
Returns true if the passed value is iterable, false otherwise
Returns true if the passed value is iterable, false otherwise

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isNumber( Mixed value) : Boolean
Returns true if the passed value is a number. Returns false for non-finite numbers.
Returns true if the passed value is a number. Returns false for non-finite numbers.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isNumeric( Mixed value) : Boolean
Validates that a value is numeric.
Validates that a value is numeric.

Parameters

  • value : Mixed
    Examples: 1, '1', '2.34'

Returns

  • Boolean   True if numeric, false otherwise
 
isObject( Mixed value) : Boolean
Returns true if the passed value is a JavaScript Object, false otherwise.
Returns true if the passed value is a JavaScript Object, false otherwise.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isPrimitive( Mixed value) : Boolean
Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
isString( Mixed value) : Boolean
Returns true if the passed value is a string.
Returns true if the passed value is a string.

Parameters

  • value : Mixed
    The value to test

Returns

  • Boolean
 
iterate( Object/Array object, Function fn, Object scope) : Void
Iterates either the elements in an array, or each of the properties in an object. Note: If you are only iterating arr...
Iterates either the elements in an array, or each of the properties in an object. Note: If you are only iterating arrays, it is better to call each.

Parameters

  • object : Object/Array
    The object or array to be iterated
  • fn : Function
    The function to be called for each iteration. The iteration will stop if the supplied function returns false, or all array elements / object properties have been covered. The signature varies depending on the type of object being interated:
    • Arrays : (Object item, Number index, Array allItems)
      When iterating an array, the supplied function is called with each item.
    • Objects : (String key, Object value, Object)
      When iterating an object, the supplied function is called with each key-value pair in the object, and the iterated object
  • scope : Object
    The scope (this reference) in which the specified function is executed. Defaults to the object being iterated.

Returns

  • Void
 
max( Array|NodeList arr, [Function comp]) : Object
Returns the maximum value in the Array
Returns the maximum value in the Array

Parameters

  • arr : Array|NodeList
    The Array from which to select the maximum value.
  • comp : Function
    (optional) a function to perform the comparision which determines maximization. If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1

Returns

  • Object   The maximum value in the Array.
 
mean( Array arr) : Number
Calculates the mean of the Array
Calculates the mean of the Array

Parameters

  • arr : Array
    The Array to calculate the mean value of.

Returns

  • Number   The mean.
 
A convenient alias method for Ext.Object-merge
A convenient alias method for Ext.Object-merge

Returns

  • Void
 
min( Array|NodeList arr, [Function comp]) : Object
Returns the minimum value in the Array.
Returns the minimum value in the Array.

Parameters

  • arr : Array|NodeList
    The Array from which to select the minimum value.
  • comp : Function
    (optional) a function to perform the comparision which determines minimization. If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1

Returns

  • Object   The minimum value in the Array.
 
namespace( String namespace1, String namespace2, String etc) : Object
Creates namespaces to be used for scoping variables and classes so that they are not global. Specifying the last node...

Creates namespaces to be used for scoping variables and classes so that they are not global. Specifying the last node of a namespace implicitly creates all other nodes. Usage:

Ext.namespace('Company', 'Company.data');

 // equivalent and preferable to the above syntax
Ext.namespace('Company.data');

Company.Widget = function() { ... };

Company.data.CustomStore = function(config) { ... };

Parameters

  • namespace1 : String
  • namespace2 : String
  • etc : String

Returns

  • Object   The namespace object. (If multiple arguments are passed, this will be the last namespace created)
 
Convenient alias for Ext.namespace
Convenient alias for Ext.namespace

Returns

  • Void
 
Alias for Ext.EventManager.onDocumentReady
 
Alias for Ext.Loader.onReady with withDomReady set to true
Alias for Ext.Loader.onReady with withDomReady set to true

Returns

  • Void
 
override( Object origclass, Object overrides) : Void
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.

Parameters

  • origclass : Object
    The class to override
  • overrides : Object
    The list of functions to add to origClass. This should be specified as an object literal containing one or more methods.

Returns

  • Void
 
partition( Array|NodeList arr, [Function truth]) : Array
Partitions the set into two sets: a true set and a false set. Example: Example2: // Example 1: Ext.partition([true, f...
Partitions the set into two sets: a true set and a false set. Example: Example2:
// Example 1:
Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]

// Example 2:
Ext.partition(
    Ext.query("p"),
    function(val){
        return val.className == "class1"
    }
);
// true are those paragraph elements with a className of "class1",
// false set are those that do not have that className.

Parameters

  • arr : Array|NodeList
    The array to partition
  • truth : Function
    (optional) a function to determine truth. If this is omitted the element itself must be able to be evaluated for its truthfulness.

Returns

  • Array   [true,false]
 
Shorthand for Ext.Function-pass
Shorthand for Ext.Function-pass

Returns

  • Void
 
This method is deprecated, Use Ext.Array-pluck instead
This method is deprecated, Use Ext.Array-pluck instead

Returns

  • Void
 
preg( String ptype, Constructor cls) : Void
Shorthand for Ext.PluginMgr-registerType
Shorthand for Ext.PluginMgr-registerType

Parameters

  • ptype : String
    The ptype mnemonic string by which the Plugin class may be looked up.
  • cls : Constructor
    The new Plugin class.

Returns

  • Void
 
query( String path, [Node root]) : Array
Selects an array of DOM nodes by CSS/XPath selector. Shorthand of Ext.DomQuery-select
Selects an array of DOM nodes by CSS/XPath selector. Shorthand of Ext.DomQuery-select

Parameters

  • path : String
    The selector/xpath query
  • root : Node
    (optional) The start of the query (defaults to document).

Returns

  • Array
 
Shorthand for Ext.Dispatcher-redirect. Dispatches a request to a controller action, adding to the History stack and u...
Shorthand for Ext.Dispatcher-redirect. Dispatches a request to a controller action, adding to the History stack and updating the page url as necessary.

Returns

  • Void
 
regApplication( Object config) : Ext.Application
Shorthand for Ext.ApplicationManager.register Creates a new Application class from the specified config object. See E...
Shorthand for Ext.ApplicationManager.register Creates a new Application class from the specified config object. See Ext.Application for full examples.

Parameters

  • config : Object
    A configuration object for the Model you wish to create.

Returns

  • Ext.Application   The newly created Application
 
regController( Object config) : Ext.Controller
Shorthand for Ext.ControllerManager.register Creates a new Controller class from the specified config object. See Ext...
Shorthand for Ext.ControllerManager.register Creates a new Controller class from the specified config object. See Ext.Controller for full examples.

Parameters

  • config : Object
    A configuration object for the Controller you wish to create.

Returns

  • Ext.Controller   The newly registered Controller
 
regModel( Object config) : Ext.data.Model
Shorthand for Ext.ModelMgr-registerType Creates a new Model class from the specified config object. See Ext.data.Mode...
Shorthand for Ext.ModelMgr-registerType Creates a new Model class from the specified config object. See Ext.data.Model for full examples.

Parameters

  • config : Object
    A configuration object for the Model you wish to create.

Returns

  • Ext.data.Model   The newly registered Model
 
regStore( String id, Object config, Constructor cls) : Void
Creates a new store for the given id and config, then registers it with the Store Mananger. Sample usage: Ext.re...

Creates a new store for the given id and config, then registers it with the Store Mananger. Sample usage:

Ext.regStore('AllUsers', {
        model: 'User'
    });

    //the store can now easily be used throughout the application
    new Ext.List({
        store: 'AllUsers',
        ... other config
    });

Parameters

  • id : String
    The id to set on the new store
  • config : Object
    The store config
  • cls : Constructor
    The new Component class.

Returns

  • Void
 
removeNode( HTMLElement node) : Void
Removes a DOM node from the document. Removes this element from the document, removes all DOM event listeners, and de...
Removes a DOM node from the document.

Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. All DOM event listeners are removed from this element. If Ext.enableNestedListenerRemoval is true, then DOM event listeners are also removed from all child nodes. The body node will be ignored if passed in.

Parameters

  • node : HTMLElement
    The node to remove

Returns

  • Void
 
Convenient shortcut to Ext.Loader-require
Convenient shortcut to Ext.Loader-require

Returns

  • Void
 
select( String/Array selector, [HTMLElement/String root]) : CompositeElementLite/CompositeElement
Selects elements based on the passed CSS selector to enable Element methods to be applied to many related elements in...
Selects elements based on the passed CSS selector to enable Element methods to be applied to many related elements in one statement through the returned CompositeElement or CompositeElementLite object.

Parameters

  • selector : String/Array
    The CSS selector or an array of elements
  • root : HTMLElement/String
    (optional) The root element of the query or id of the root

Returns

  • CompositeElementLite/CompositeElement
 
sum( Array arr) : Number
Calculates the sum of the Array
Calculates the sum of the Array

Parameters

  • arr : Array
    The Array to calculate the sum value of.

Returns

  • Number   The sum.
 
This method is deprecated, use Ext.Array-toArray instead
This method is deprecated, use Ext.Array-toArray instead

Returns

  • Void
 
toSentence( Array items, String connector) : String
Turns an array into a sentence, joined by a specified connector - e.g.: Ext.toSentence(['Adama', 'Tigh', 'Roslin']); ...
Turns an array into a sentence, joined by a specified connector - e.g.: Ext.toSentence(['Adama', 'Tigh', 'Roslin']); //'Adama, Tigh and Roslin' Ext.toSentence(['Adama', 'Tigh', 'Roslin'], 'or'); //'Adama, Tigh or Roslin'

Parameters

  • items : Array
    The array to create a sentence from
  • connector : String
    The string to use to connect the last two words. Usually 'and' or 'or' - defaults to 'and'.

Returns

  • String   The sentence string
 
type( Mixed object) : String
Returns the type of object that is passed in. If the object passed in is null or undefined it return false otherwise ...
Returns the type of object that is passed in. If the object passed in is null or undefined it return false otherwise it returns one of the following values:
  • string: If the object passed is a string
  • number: If the object passed is a number
  • boolean: If the object passed is a boolean value
  • date: If the object passed is a Date object
  • function: If the object passed is a function reference
  • object: If the object passed is an object
  • array: If the object passed is an array
  • regexp: If the object passed is a regular expression
  • element: If the object passed is a DOM Element
  • nodelist: If the object passed is a DOM NodeList
  • textnode: If the object passed is a DOM text node and contains something other than whitespace
  • whitespace: If the object passed is a DOM text node and contains only whitespace

Parameters

  • object : Mixed

Returns

  • String
 
unique( Array arr) : Array
Creates a copy of the passed Array, filtered to contain only unique values.
Creates a copy of the passed Array, filtered to contain only unique values.

Parameters

  • arr : Array
    The Array to filter

Returns

  • Array   The new Array containing unique values.
 
urlAppend( String url, String s) : (String)
Appends content to the query string of a URL, handling logic for whether to place a question mark or ampersand.
Appends content to the query string of a URL, handling logic for whether to place a question mark or ampersand.

Parameters

  • url : String
    The URL to append to.
  • s : String
    The content to append to the URL.

Returns

  • (String)   The resulting URL
 
urlDecode( String string, [Boolean overwrite]) : Object
Takes an encoded URL and and converts it to an object. Example: Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", b...
Takes an encoded URL and and converts it to an object. Example:
Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {foo: "1", bar: ["2", "3", "4"]}

Parameters

  • string : String
  • overwrite : Boolean
    (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false).

Returns

  • Object   A literal with members
 
urlEncode( Object o, [String pre]) : String
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". ...
Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2". Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.

Parameters

  • o : Object
    The object to encode
  • pre : String
    (optional) A prefix to add to the url encoded string

Returns

  • String
 
value( Mixed value, Mixed defaultValue, [Boolean allowBlank]) : Mixed
Utility method for returning a default value if the passed value is empty. The value is deemed to be empty if it is<d...

Utility method for returning a default value if the passed value is empty.

The value is deemed to be empty if it is

  • null
  • undefined
  • an empty array
  • a zero length string (Unless the allowBlank parameter is true)

Parameters

  • value : Mixed
    The value to test
  • defaultValue : Mixed
    The value to return if the original value is empty
  • allowBlank : Boolean
    (optional) true to allow zero length strings to qualify as non-empty (defaults to false)

Returns

  • Mixed   value, if non-empty, else defaultValue
 
Convenient shorthand to create a widget by its xtype, also see Ext.ClassManager-instantiateByAlias var button = ...

Convenient shorthand to create a widget by its xtype, also see Ext.ClassManager-instantiateByAlias

var button = Ext.widget('button'); // Equivalent to Ext.create('widget.button')
var panel = Ext.widget('panel'); // Equivalent to Ext.create('widget.panel')

Returns

  • Void
 
zip( Arrays|NodeLists arr, [Function zipper]) : Array
Zips N sets together. // Example 1: Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]] // Example 2: Ext.zip( [ "+"...

Zips N sets together.

// Example 1:
Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
// Example 2:
Ext.zip(
    [ "+", "-", "+"],
    [  12,  10,  22],
    [  43,  15,  96],
    function(a, b, c){
        return "$" + a + "" + b + "." + c
    }
); // ["$+12.43", "$-10.15", "$+22.96"]

Parameters

  • arr : Arrays|NodeLists
    This argument may be repeated. Array(s) to contribute values.
  • zipper : Function
    (optional) The last item in the argument list. This will drive how the items are zipped together.

Returns

  • Array   The zipped set.