Clear Up
SharpKit Reference

ExtContext Class

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.ComponentManager.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

Namespace: Ext

Base Types

Methods

Name Description
addBehaviors(object) 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
            }
            });
            
application(object) Loads Ext.app.Application class and starts it up with given configuration after the page is ready. See Ext.app.Application for details.
apply(object, object, object) Copies all the properties of config to the specified object. Note that if recursive merging and cloning without referencing the original objects / arrays is needed, use Ext.Object.merge instead.
applyIf(object, object) Copies all the properties of config to object if they don't already exist.
batchLayouts(Delegate, object) Utility wrapper that suspends layouts of all components for the duration of a given function.
bind(Delegate, object, object, object) Create a new function from the provided fn, change this to the provided scope, optionally overrides arguments for the call. (Defaults to the arguments passed by the caller) Ext.bind is alias for Ext.Function.bind
callback(Delegate, object, object, object) Execute a callback function in a particular scope. If no function is passed the call is ignored. For example, these lines are equivalent:
  Ext.callback(myFunc, this, [arg1, arg2]);
            Ext.isFunction(myFunc) && myFunc.apply(this, [arg1, arg2]);
            
clean(JsArray) Old alias to Ext.Array.clean Filter through an array and remove empty item as defined in Ext.isEmpty See Ext.Array.filter

This method has been deprecated since 4.0.0

Use Ext.Array.clean instead

clone(object) Clone simple variables including array, {}-like objects, DOM nodes and Date without keeping the old reference. A reference for the object itself is returned if it's not a direct decendant of Object. For model cloning, see Model.copy.
copyTo(object, object, object, object) 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');
            }
            });
            
Important note: To borrow class prototype methods, use Ext.Base.borrow instead.
create(object, Object[]) Instantiate a class by either full name, alias or alternate name. If Ext.Loader is enabled and the class has not been defined yet, it will attempt to load the class via synchronous loading. For example, all these three lines return the same result:
// alias
           var window = Ext.create('widget.window', {
           width: 600,
           height: 800,
           ...
           });
           // alternate name
           var window = Ext.create('Ext.Window', {
           width: 600,
           height: 800,
           ...
           });
           // full class name
           var window = Ext.create('Ext.window.Window', {
           width: 600,
           height: 800,
           ...
           });
           // single object with xclass property:
           var window = Ext.create({
           xclass: 'Ext.window.Window', // any valid value for 'name' (above)
           width: 600,
           height: 800,
           ...
           });
            
createByAlias(JsString, Object[]) Convenient shorthand, see Ext.ClassManager.instantiateByAlias
createWidget() Old name for widget.

This method has been deprecated since 4.0.0

Use widget instead.

decode(JsString, object) Shorthand for Ext.JSON.decode Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set.
defer(Delegate, JsNumber, object, object, object) Calls this function after the number of millseconds specified, optionally in a specific scope. Example usage:
var sayHi = function(name){
            alert('Hi, ' + name);
            }
            // executes immediately:
            sayHi('Fred');
            // executes after 2 seconds:
            Ext.Function.defer(sayHi, 2000, this, ['Fred']);
            // this syntax is sometimes useful for deferring
            // execution of an anonymous function:
            Ext.Function.defer(function(){
            alert('Anonymous');
            }, 100);
            
Ext.defer is alias for Ext.Function.defer
define(JsString, object, object) Defines a class or override. A basic class is defined like this:
  Ext.define('My.awesome.Class', {
            someProperty: 'something',
            someMethod: function(s) {
            alert(s + this.someProperty);
            }
            ...
            });
            var obj = new My.awesome.Class();
            obj.someMethod('Say '); // alerts 'Say something'
            
To create an anonymous class, pass null for the className:
  Ext.define(null, {
            constructor: function () {
            // ...
            }
            });
            
In some cases, it is helpful to create a nested scope to contain some private properties. The best way to do this is to pass a function instead of an object as the second parameter. This function will be called to produce the class body:
  Ext.define('MyApp.foo.Bar', function () {
            var id = 0;
            return {
            nextId: function () {
            return ++id;
            }
            };
            });
            
When using this form of Ext.define , the function is passed a reference to its class. This can be used as an efficient way to access any static properties you may have:
  Ext.define('MyApp.foo.Bar', function (Bar) {
            return {
            statics: {
            staticMethod: function () {
            // ...
            }
            },
            method: function () {
            return Bar.staticMethod();
            }
            };
            });
            
To define an override, include the override property. The content of an override is aggregated with the specified class in order to extend or modify that class. This can be as simple as setting default property values or it can extend and/or replace methods. This can also extend the statics of the class. One use for an override is to break a large class into manageable pieces.
// File: /src/app/Panel.js
           Ext.define('My.app.Panel', {
           extend: 'Ext.panel.Panel',
           requires: [
           'My.app.PanelPart2',
           'My.app.PanelPart3'
           ]
           constructor: function (config) {
           this.callParent(arguments); // calls Ext.panel.Panel's constructor
           //...
           },
           statics: {
           method: function () {
           return 'abc';
           }
           }
           });
           // File: /src/app/PanelPart2.js
           Ext.define('My.app.PanelPart2', {
           override: 'My.app.Panel',
           constructor: function (config) {
           this.callParent(arguments); // calls My.app.Panel's constructor
           //...
           }
           });
            
Another use of overrides is to provide optional parts of classes that can be independently required. In this case, the class may even be unaware of the override altogether.
  Ext.define('My.ux.CoolTip', {
            override: 'Ext.tip.ToolTip',
            constructor: function (config) {
            this.callParent(arguments); // calls Ext.tip.ToolTip's constructor
            //...
            }
            });
            
The above override can now be required as normal.
  Ext.define('My.app.App', {
            requires: [
            'My.ux.CoolTip'
            ]
            });
            
Overrides can also contain statics:
  Ext.define('My.app.BarMod', {
            override: 'Ext.foo.Bar',
            statics: {
            method: function (x) {
            return this.callParent([x * 2]); // call Ext.foo.Bar.method
            }
            }
            });
            
IMPORTANT: An override is only included in a build if the class it overrides is required. Otherwise, the override, like the target class, is not included.
deprecate(JsString, JsString, Delegate, object) Create a closure for deprecated code.
// This means Ext.oldMethod is only supported in 4.0.0beta and older.
            // If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
            // the closure will not be invoked
            Ext.deprecate('extjs', '4.0.0beta', function() {
            Ext.oldMethod = Ext.newMethod;
            ...
            });
            
destroy(object) 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.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.
destroyMembers(object, object) Attempts to destroy and then remove a set of named properties of the passed object.
each(object, Delegate, object, object) Iterates an array or an iterable value and invoke the given callback function for each item.
var countries = ['Vietnam', 'Singapore', 'United States', 'Russia'];
            Ext.Array.each(countries, function(name, index, countriesItSelf) {
            console.log(name);
            });
            var sum = function() {
            var sum = 0;
            Ext.Array.each(arguments, function(value) {
            sum += value;
            });
            return sum;
            };
            sum(1, 2, 3); // returns 6
            
The iteration can be stopped by returning false in the function callback.
  Ext.Array.each(countries, function(name, index, countriesItSelf) {
            if (name === 'Singapore') {
            return false; // break here
            }
            });
            
Ext.each is alias for Ext.Array.each
encode(object) Shorthand for Ext.JSON.encode Encodes an Object, Array or other value. If the environment's native JSON encoding is not being used (USE_NATIVE_JSON is not set, or the environment does not support it), then ExtJS's encoding will be used. This allows the developer to add a toJSON method to their classes which need serializing to return a valid JSON representation of the object.
escapeRe(JsString) Escapes the passed string for use in a regular expression.

This method has been deprecated since 4.0.0

Use Ext.String.escapeRegex instead

exclude() Convenient shortcut to Ext.Loader.exclude
extend(Delegate, object) This method deprecated. Use Ext.define instead.

This method has been deprecated since 4.0.0

Use Ext.define instead

flatten(JsArray) Old alias to Ext.Array.flatten Recursively flattens into 1-d Array. Injects Arrays inline.

This method has been deprecated since 4.0.0

Use Ext.Array.flatten instead

fly(object, object) Gets the singleton flyweight element, with the passed node as the active element. Because it is a singleton, this Flyweight does not have an ID, and must be used and discarded in a single line. You may not keep and use the reference to this singleton over multiple lines because methods that you call may themselves make use of fly and may change the DOM element to which the instance refers. fly is alias for Ext.dom.AbstractElement.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.dom.Element class.
get(object) Retrieves Ext.dom.Element objects. get is alias for Ext.dom.Element.get. This method does not retrieve Components. This method retrieves Ext.dom.Element objects which encapsulate DOM elements. To retrieve a Component by its ID, use Ext.ComponentManager.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.
getBody() Returns the current document body as an Ext.Element.
getClass(object) Convenient shorthand, see Ext.ClassManager.getClass
getClassName(object) Convenient shorthand, see Ext.ClassManager.getName
getCmp(JsString) This is shorthand reference to Ext.ComponentManager.get. Looks up an existing Component by id
getDoc() Returns the current HTML document object as an Ext.Element.
getDom(object) Returns the dom node for the passed String (id), dom node, or Ext.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.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.
getHead() Returns the current document head as an Ext.Element.
getOrientation() Returns the current orientation of the mobile device
getScrollbarSize(object) Returns the size of the browser scrollbars. This can differ depending on operating system settings, such as the theme or font size.
getScrollBarWidth(object) Utility method for getting the width of the browser's vertical scrollbar. This can differ depending on operating system settings, such as the theme or font size. This method is deprected in favor of getScrollbarSize.

This method has been deprecated

getStore(object) Shortcut to Ext.data.StoreManager.lookup. Gets a registered Store by id
getVersion(object) Get the version number of the supplied package name; will return the last registered version (last Ext.setVersion call) if there's no package name given.
htmlDecode(JsString) Old alias to Ext.String.htmlDecode Convert certain characters (&, <, >, ', and ") from their HTML character equivalents.

This method has been deprecated

Use Ext.String.htmlDecode instead

htmlEncode(JsString) Old alias to Ext.String.htmlEncode Convert certain characters (&, <, >, ', and ") to their HTML character equivalents for literal display in web pages.

This method has been deprecated

Use Ext.String.htmlEncode instead

id(object, object) Generates unique ids. If the element already has an id, it is unchanged
invoke(object, JsString, object) 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")]
            

This method has been deprecated since 4.0.0

Will be removed in the next major version

isArray(object) Returns true if the passed value is a JavaScript Array, false otherwise.
isBoolean(object) Returns true if the passed value is a boolean.
isDate(object) Returns true if the passed value is a JavaScript Date object, false otherwise.
isDefined(object) Returns true if the passed value is defined.
isElement(object) Returns true if the passed value is an HTMLElement
isEmpty(object, object) Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if it is either:
  • null
  • undefined
  • a zero-length array
  • a zero-length string (Unless the allowEmptyString parameter is set to true)
  • isFunction(object) Returns true if the passed value is a JavaScript Function, false otherwise.
    isIterable(object) Returns true if the passed value is iterable, false otherwise
    isNumber(object) Returns true if the passed value is a number. Returns false for non-finite numbers.
    isNumeric(object) Validates that a value is numeric.
    isObject(object) Returns true if the passed value is a JavaScript Object, false otherwise.
    isPrimitive(object) Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
    isString(object) Returns true if the passed value is a string.
    isTextNode(object) Returns true if the passed value is a TextNode
    iterate(object, Delegate, object) Iterates either an array or an object. This method delegates to Ext.Array.each if the given value is iterable, and Ext.Object.each otherwise.
    log(object, object) Logs a message. If a console is present it will be used. On Opera, the method "opera.postError" is called. In other cases, the message is logged to an array "Ext.log.out". An attached debugger can watch this array and view the log. The log buffer is limited to a maximum of "Ext.log.max" entries (defaults to 250). The Ext.log.out array can also be written to a popup window by entering the following in the URL bar (a "bookmarklet"):
    javascript:void(Ext.log.show());
                
    If additional parameters are passed, they are joined and appended to the message. A technique for tracing entry and exit of a function is this:
    function foo () {
                Ext.log({ indent: 1 }, '>> foo');
                // log statements in here or methods called from here will be indented
                // by one step
                Ext.log({ outdent: 1 }, '<< foo');
                }
                
    This method does nothing in a release build.
    max(object, object) Old alias to Ext.Array.max Returns the maximum value in the Array.

    This method has been deprecated since 4.0.0

    Use Ext.Array.max instead

    mean(JsArray) Old alias to Ext.Array.mean Calculates the mean of all items in the array.

    This method has been deprecated since 4.0.0

    Use Ext.Array.mean instead

    merge(object, object) A convenient alias method for Ext.Object.merge. Merges any number of objects recursively without referencing them or their children.
    var extjs = {
                companyName: 'Ext JS',
                products: ['Ext JS', 'Ext GWT', 'Ext Designer'],
                isSuperCool: true,
                office: {
                size: 2000,
                location: 'Palo Alto',
                isFun: true
                }
                };
                var newStuff = {
                companyName: 'Sencha Inc.',
                products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
                office: {
                size: 40000,
                location: 'Redwood City'
                }
                };
                var sencha = Ext.Object.merge(extjs, newStuff);
                // extjs and sencha then equals to
                {
                companyName: 'Sencha Inc.',
                products: ['Ext JS', 'Ext GWT', 'Ext Designer', 'Sencha Touch', 'Sencha Animator'],
                isSuperCool: true,
                office: {
                size: 40000,
                location: 'Redwood City',
                isFun: true
                }
                }
                
    min(object, object) Old alias to Ext.Array.min Returns the minimum value in the Array.

    This method has been deprecated since 4.0.0

    Use Ext.Array.min instead

    namespace(JsString) 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.ns('Company.data');
                Company.Widget = function() { ... };
                Company.data.CustomStore = function(config) { ... };
                
    ns(JsString) Convenient alias for Ext.namespace. 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.ns('Company.data');
                Company.Widget = function() { ... };
                Company.data.CustomStore = function(config) { ... };
                
    num(object, JsNumber) Validate that a value is numeric and convert it to a number if necessary. Returns the specified default value if it is not.
      Ext.Number.from('1.23', 1); // returns 1.23
                Ext.Number.from('abc', 1); // returns 1
                

    This method has been deprecated since 4.0.0

    Please use Ext.Number.from instead.

    onDocumentReady() Alias for Ext.EventManager.onDocumentReady
    onReady(Delegate, object, object) Alias for Ext.Loader.onReady with withDomReady set to true
    override(object, object) Overrides members of the specified target with the given values. If the target is a class declared using Ext.define, the override method of that class is called (see Ext.Base.override) given the overrides. If the target is a function, it is assumed to be a constructor and the contents of overrides are applied to its prototype using Ext.apply. If the target is an instance of a class declared using Ext.define, the overrides are applied to only that instance. In this case, methods are specially processed to allow them to use Ext.Base.callParent.
    var panel = new Ext.Panel({ ... });
               Ext.override(panel, {
               initComponent: function () {
               // extra processing...
               this.callParent();
               }
               });
                
    If the target is none of these, the overrides are applied to the target using Ext.apply. Please refer to Ext.define and Ext.Base.override for further details.
    partition(object, object) Partitions the set into two sets: a true set and a false set. Example 1:
      Ext.partition([true, false, true, true, false]);
                // returns [[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.
                

    This method has been deprecated since 4.0.0

    Will be removed in the next major version

    pass(Delegate, object, object) Create a new function from the provided fn, the arguments of which are pre-set to args. New arguments passed to the newly created callback when it's invoked are appended after the pre-set ones. This is especially useful when creating callbacks. For example:
    var originalFunction = function(){
                alert(Ext.Array.from(arguments).join(' '));
                };
                var callback = Ext.Function.pass(originalFunction, ['Hello', 'World']);
                callback(); // alerts 'Hello World'
                callback('by Me'); // alerts 'Hello World by Me'
                
    Ext.pass is alias for Ext.Function.pass
    pluck(object, JsString) Old alias to Ext.Array.pluck Plucks the value of a property from each item in the Array. Example:
      Ext.Array.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
                

    This method has been deprecated since 4.0.0

    Use Ext.Array.pluck instead

    preg(JsString, Delegate) Shorthand for Ext.PluginManager.registerType
    query(object, object, object) Shorthand of Ext.dom.Query.select Selects an array of DOM nodes by CSS/XPath selector. Uses document.querySelectorAll if browser supports that, otherwise falls back to Ext.dom.Query.jsSelect to do the work. Aliased as query.
    regModel(JsString, object) Old way for creating Model classes. Instead use:
      Ext.define("MyModel", {
                extend: "Ext.data.Model",
                fields: []
                });
                

    This method has been deprecated since 4.0.0

    Use define instead.

    regStore(JsString, object) Creates a new store for the given id and config, then registers it with the Store Manager. Sample usage:
      Ext.regStore('AllUsers', {
                model: 'User'
                });
                // the store can now easily be used throughout the application
                new Ext.List({
                store: 'AllUsers',
                ... other config
                });
                
    removeNode(object) 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.
    require(Object[]) Convenient alias of Ext.Loader.require. Please see the introduction documentation of Ext.Loader for examples.
    resumeLayouts(object) Resumes layout activity in the whole framework. suspendLayouts is alias of Ext.AbstractComponent.suspendLayouts.
    select(JsString, object) Shorthand of Ext.Element.select. Creates a Ext.CompositeElement for child nodes based on the passed CSS selector (the selector should not contain an id).
    setVersion(JsString, object) Set version number for the given package name.
    sum(JsArray) Old alias to Ext.Array.sum Calculates the sum of all items in the given array.

    This method has been deprecated since 4.0.0

    Use Ext.Array.sum instead

    suspendLayouts() Stops layouts from happening in the whole framework. It's useful to suspend the layout activity while updating multiple components and containers:
      Ext.suspendLayouts();
                // batch of updates...
                Ext.resumeLayouts(true);
                
    suspendLayouts is alias of Ext.AbstractComponent.suspendLayouts. See also batchLayouts for more abstract way of doing this.
    syncRequire() Synchronous version of require, convenient alias of Ext.Loader.syncRequire.
    toArray(object, object, object) Converts any iterable (numeric indices and a length property) into a true array.
    function test() {
                var args = Ext.Array.toArray(arguments),
                fromSecondToLastArgs = Ext.Array.toArray(arguments, 1);
                alert(args.join(' '));
                alert(fromSecondToLastArgs.join(' '));
                }
                test('just', 'testing', 'here'); // alerts 'just testing here';
                // alerts 'testing here';
                Ext.Array.toArray(document.getElementsByTagName('div')); // will convert the NodeList into an array
                Ext.Array.toArray('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd']
                Ext.Array.toArray('splitted', 0, 3); // returns ['s', 'p', 'l']
                
    Ext.toArray is alias for Ext.Array.toArray
    toSentence(JsArray<T>, JsString) 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'
                

    This method has been deprecated since 4.0.0

    Will be removed in the next major version

    type(object) Old alias to typeOf Returns the type of the given variable in string format. List of possible values are:
  • undefined: If the given value is undefined
  • null: If the given value is null
  • string: If the given value is a string
  • number: If the given value is a number
  • boolean: If the given value is a boolean value
  • date: If the given value is a Date object
  • function: If the given value is a function reference
  • object: If the given value is an object
  • array: If the given value is an array
  • regexp: If the given value is a regular expression
  • element: If the given value is a DOM Element
  • textnode: If the given value is a DOM text node and contains something other than whitespace
  • whitespace: If the given value is a DOM text node and contains only whitespace
  • This method has been deprecated since 4.0.0

    Use typeOf instead

    typeOf(object) Returns the type of the given variable in string format. List of possible values are:
  • undefined: If the given value is undefined
  • null: If the given value is null
  • string: If the given value is a string
  • number: If the given value is a number
  • boolean: If the given value is a boolean value
  • date: If the given value is a Date object
  • function: If the given value is a function reference
  • object: If the given value is an object
  • array: If the given value is an array
  • regexp: If the given value is a regular expression
  • element: If the given value is a DOM Element
  • textnode: If the given value is a DOM text node and contains something other than whitespace
  • whitespace: If the given value is a DOM text node and contains only whitespace
  • unique(JsArray) Old alias to Ext.Array.unique Returns a new array with unique items

    This method has been deprecated since 4.0.0

    Use Ext.Array.unique instead

    urlAppend(JsString, JsString) Old alias to Ext.String.urlAppend Appends content to the query string of a URL, handling logic for whether to place a question mark or ampersand.

    This method has been deprecated

    Use Ext.String.urlAppend instead

    urlDecode(JsString, object) Alias for Ext.Object.fromQueryString. Converts a query string back into an object. Non-recursive:
      Ext.Object.fromQueryString("foo=1&bar=2"); // returns {foo: 1, bar: 2}
                Ext.Object.fromQueryString("foo=&bar=2"); // returns {foo: null, bar: 2}
                Ext.Object.fromQueryString("some%20price=%24300"); // returns {'some price': '$300'}
                Ext.Object.fromQueryString("colors=red&colors=green&colors=blue"); // returns {colors: ['red', 'green', 'blue']}
                
    Recursive:
      Ext.Object.fromQueryString(
                "username=Jacky&"+
                "dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911&"+
                "hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&"+
                "hobbies[3][0]=nested&hobbies[3][1]=stuff", true);
                // returns
                {
                username: 'Jacky',
                dateOfBirth: {
                day: '1',
                month: '2',
                year: '1911'
                },
                hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
                }
                

    This method has been deprecated since 4.0.0

    Use Ext.Object.fromQueryString instead

    urlEncode(object, object) Takes an object and converts it to an encoded query string. Non-recursive:
      Ext.Object.toQueryString({foo: 1, bar: 2}); // returns "foo=1&bar=2"
                Ext.Object.toQueryString({foo: null, bar: 2}); // returns "foo=&bar=2"
                Ext.Object.toQueryString({'some price': '$300'}); // returns "some%20price=%24300"
                Ext.Object.toQueryString({date: new Date(2011, 0, 1)}); // returns "date=%222011-01-01T00%3A00%3A00%22"
                Ext.Object.toQueryString({colors: ['red', 'green', 'blue']}); // returns "colors=red&colors=green&colors=blue"
                
    Recursive:
      Ext.Object.toQueryString({
                username: 'Jacky',
                dateOfBirth: {
                day: 1,
                month: 2,
                year: 1911
                },
                hobbies: ['coding', 'eating', 'sleeping', ['nested', 'stuff']]
                }, true); // returns the following string (broken down and url-decoded for ease of reading purpose):
                // username=Jacky
                //    &dateOfBirth[day]=1&dateOfBirth[month]=2&dateOfBirth[year]=1911
                //    &hobbies[0]=coding&hobbies[1]=eating&hobbies[2]=sleeping&hobbies[3][0]=nested&hobbies[3][1]=stuff
                

    This method has been deprecated since 4.0.0

    Use Ext.Object.toQueryString instead

    value(object, object, object) 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)
  • This method has been deprecated since 4.0.0

    Use valueFrom instead

    valueFrom(object, object, object) Returns the given value itself if it's not empty, as described in isEmpty; returns the default value (second argument) otherwise.
    widget(object, object) Convenient shorthand to create a widget by its xtype or a config object. See also 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')
               title: 'Panel'
               });
               var grid = Ext.widget({
               xtype: 'grid',
               ...
               });
                
    If a component instance is passed, it is simply returned.
    zip(object, object) 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"]
                

    This method has been deprecated since 4.0.0

    Will be removed in the next major version

    Properties

    Name Description
    BLANK_IMAGE_URL 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://sencha.com/s.gif" and you should change this to a URL on your server. For other browsers it uses an inline data URL.
    chromeVersion The current version of Chrome (0 if the browser is not Chrome).
    Direct
    emptyFn A reusable empty function
    emptyString A zero length string which will pass a truth test. Useful for passing to methods which use a truth test to reject falsy values where a string value must be cleared.
    enableFx True if the Ext.fx.Anim Class is available.
    enableGarbageCollector True to automatically uncache orphaned Ext.Elements periodically Defaults to: true
    enableListenerCollection True to automatically purge event listeners during garbageCollection. Defaults to: true
    enableNestedListenerRemoval Experimental. True to cascade listener removal to child elements when an element is removed. Currently not optimized for performance. Defaults to: false
    enumerables An array containing extra enumerables for old browsers
    firefoxVersion The current version of Firefox (0 if the browser is not Firefox).
    ieVersion The current version of IE (0 if the browser is not IE). This does not account for the documentMode of the current page, which is factored into isIE7, isIE8 and isIE9. Thus this is not always true:
      Ext.isIE8 == (Ext.ieVersion == 8)
                
    isChrome True if the detected browser is Chrome.
    isFF10 True if the detected browser uses FireFox 10
    isFF3_0 True if the detected browser uses FireFox 3.0
    isFF3_5 True if the detected browser uses FireFox 3.5
    isFF3_6 True if the detected browser uses FireFox 3.6
    isFF4 True if the detected browser uses FireFox 4
    isFF5 True if the detected browser uses FireFox 5
    isGecko True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
    isGecko10 True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
    isGecko3 True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
    isGecko4 True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
    isGecko5 True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
    isIE True if the detected browser is Internet Explorer.
    isIE6 True if the detected browser is Internet Explorer 6.x.
    isIE7 True if the detected browser is Internet Explorer 7.x.
    isIE8 True if the detected browser is Internet Explorer 8.x.
    isIE9 True if the detected browser is Internet Explorer 9.x.
    isLinux True if the detected platform is Linux.
    isMac True if the detected platform is Mac OS.
    isOpera True if the detected browser is Opera.
    isOpera10_5 True if the detected browser is Opera 10.5x.
    isReady True when the document is fully initialized and ready for action Defaults to: false
    isSafari True if the detected browser is Safari.
    isSafari2 True if the detected browser is Safari 2.x.
    isSafari3 True if the detected browser is Safari 3.x.
    isSafari4 True if the detected browser is Safari 4.x.
    isSafari5 True if the detected browser is Safari 5.x.
    isSafari5_0 True if the detected browser is Safari 5.0.x.
    isSecure True if the page is running over SSL
    isWebKit True if the detected browser uses WebKit.
    isWindows True if the detected platform is Windows.
    Msg
    name The name of the property in the global namespace (The window in browser environments) which refers to the current instance of Ext. This is usually "Ext", but if a sandboxed build of ExtJS is being used, this will be an alternative name. If code is being generated for use by eval or to create a new Function, and the global instance of Ext must be referenced, this is the name that should be built into the code. Defaults to: "Ext"
    operaVersion The current version of Opera (0 if the browser is not Opera).
    resetCls The css class used to wrap Ext components when the scopeResetCSS option is used.
    safariVersion The current version of Safari (0 if the browser is not Safari).
    scopeResetCSS 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).
    SSL_SECURE_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 warning ('about:blank', except for IE in secure mode, which is 'javascript:""').
    USE_NATIVE_JSON 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
    useShims By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you may want to set this to true.
    webKitVersion The current version of WebKit (0 if the browser does not use WebKit).
    © Copyright 2005-2011 SharpKit. All rights reserved.