Clear Up
SharpKit Reference

ExtClass Class

Namespace: Ext

Base Types

System.Object

Constructors

Name Description
ExtClass()

Methods

Name Description
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. @param {Object} config
applyIf(object, object) Copies all the properties of config to object if they don't already exist. @param {Object} object The receiver of the properties @param {Object} config The source of the properties @return {Object} returns obj
callback(JsAction, object, JsArray, JsNumber) @param {Function} callback The callback to execute @param {Object} scope (optional) The scope to execute in @param {Array} args (optional) The arguments to pass to the function @param {Number} delay (optional) Pass a number to delay the call by a number of milliseconds.
clone(object) Clone almost any type of variable including array, object, DOM nodes and Date without keeping the old reference @param {Object} item The variable to clone @return {Object} clone
create(object) @private @param Class @param classData @param onClassCreated
create(JsString, object) Instantiate a class by either full name, alias or alternate name. ...
define(JsString, object, JsAction) @method Defines a class or override. A basic class is defined like this: * Ext.define('My.awesome.Class', { someProperty: 'something', * someMethod: function() { alert(s + this.someProperty); } * ... }); * var obj = new My.awesome.Class(); * obj.someMethod('Say '); // alerts 'Say something' * To defines 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 for an override 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. * @param {String} className The class name to create in string dot-namespaced format, for example: 'My.very.awesome.Class', 'FeedViewer.plugin.CoolPager' It is highly recommended to follow this simple convention: - The root and the class name are 'CamelCased' - Everything else is lower-cased @param {Object} data The key - value pairs of properties to apply to this class. Property names can be of any valid strings, except those in the reserved listed below: - `mixins` - `statics` - `config` - `alias` - `self` - `singleton` - `alternateClassName` - `override` * @param {Function} createdFn Optional callback to execute after the class (or override) is created. The execution scope (`this`) will be the newly created class itself. @return {Ext.Base} @markdown @member Ext @method define
deprecate(JsString, JsString, JsAction, 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; ... }); @param {String} packageName The package name @param {String} since The last version before it's deprecated @param {Function} closure The callback function to be executed with the specified version is less than the current version @param {Object} scope The execution scope (this) if the closure @markdown
deprecateClassConfigDirectAccess(object, object) @private @param cls
deprecateClassMember(object, object, object, object) @private
deprecateClassMembers(object, object) @private
deprecateClassMethod(object, object, object, object) @private
deprecateMethod(object, object, object, object) @private
deprecateProperty(object, object, object, object) @private
destroy() 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 {@link Ext.Element} and {@link Ext.Component}, but any subclass of {@link 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. @param {Mixed...} args An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy
extend(object, object, object)
factory(object, object, object, object) @private @param config @param classReference @param instance
factoryConfig(object, object) @private @param config @param callback
functionFactory() @private
getBody() Returns the current document body as an {@link Ext.Element}. @return Ext.Element The document body
getCmp(JsString) This is shorthand reference to {@link Ext.ComponentMgr#get}. Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#getId id} @param {String} id The component {@link Ext.Component#getId id} @return Ext.Component The Component, undefined if not found, or null if a Class was found.
getConfigNameMap(object)
getDefaultPreprocessors() Retrieve the array stack of default pre-processors @private @return {Function} defaultPreprocessors
getDisplayName(object) * @param {Mixed} object
getDoc() Returns the current HTML document object as an {@link Ext.Element}. @return Ext.Element The document
getDom(object) Return the dom node for the passed String (id), dom node, or Ext.Element. 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. @param {Mixed} el @return HTMLElement
getHead() Returns the current document head as an {@link Ext.Element}. @return Ext.Element The document head
getPreprocessor(JsString) Retrieve a pre-processor callback function by its name, which has been registered before * @private @param {String} name @return {Function} preprocessor
getPreprocessors() @private
getUniqueGlobalNamespace() @private Generate a unique reference of Ext in the global scope, useful for sandboxing
getVersion(JsString) 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. * @param {String} packageName (Optional) The package name, for example: 'core', 'touch', 'extjs' @return {Ext.Version} The version
id(object, JsString) Generates unique ids. If the element already has an id, it is unchanged @param {Mixed} el (optional) The element to generate an id for @param {String} prefix (optional) Id prefix (defaults "ext-gen") @return {String} The generated Id.
isBoolean(object) Returns true if the passed value is a boolean. * @param {Object} value The value to test @return {Boolean}
isDate(object) Returns true if the passed value is a JavaScript Date object, false otherwise. @param {Object} object The object to test @return {Boolean}
isDefined(object) Returns true if the passed value is defined. @param {Object} value The value to test @return {Boolean}
isElement(object) Returns true if the passed value is an HTMLElement @param {Object} value The value to test @return {Boolean}
isEmpty(object, bool) 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`) * @param {Object} value The value to test @param {Boolean} allowEmptyString (optional) true to allow empty strings (defaults to false) @return {Boolean} @markdown
isIterable(object) Returns true if the passed value is iterable, false otherwise @param {Object} value The value to test @return {Boolean}
isNumber(object) Returns true if the passed value is a number. Returns false for non-finite numbers. @param {Object} value The value to test @return {Boolean}
isNumeric(object) Validates that a value is numeric. @param {Object} value Examples: 1, '1', '2.34' @return {Boolean} True if numeric, false otherwise
isPrimitive(object) Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. @param {Object} value The value to test @return {Boolean}
isSimpleObject(object) @private
isString(object) Returns true if the passed value is a string. @param {Object} value The value to test @return {Boolean}
isTextNode(object) Returns true if the passed value is a TextNode @param {Object} value The value to test @return {Boolean}
iterate(object, JsAction, object) Iterates either an array or an object. This method delegates to {@link Ext.Array#each Ext.Array.each} if the given value is iterable, and {@link Ext.Object#each Ext.Object.each} otherwise. * @param {Object/Array} object The object or array to be iterated. @param {Function} fn The function to be called for each iteration. See and {@link Ext.Array#each Ext.Array.each} and {@link Ext.Object#each Ext.Object.each} for detailed lists of arguments passed to this function depending on the given object type that is being iterated. @param {Object} scope (Optional) The scope (`this` reference) in which the specified function is executed. Defaults to the object being iterated itself. @markdown
num() This method is deprecated, please use {@link Ext.Number#from Ext.Number.from} instead * @deprecated 4.0.0 Replaced by Ext.Number.from @member Ext @method num
onBeforeCreated(object, object, object) @private @param Class @param data @param hooks
onDocumentReady(object, object) @private
onReady(object, object, object) @member Ext @method onReady
override(object, object) Proxy to {@link Ext.Base#override}. Please refer {@link Ext.Base#override} for further details. * @param {Object} cls The class to override @param {Object} overrides The properties to add to origClass. This should be specified as an object literal containing one or more properties. @method override @markdown @deprecated 4.1.0 Use {@link Ext#define Ext.define} instead
process(object, object, object) @private @param Class @param data @param onCreated
registerPreprocessor(JsString, JsAction, object, object, object) Register a new pre-processor to be used during the class creation process * @member Ext.Class registerPreprocessor @param {String} name The pre-processor's name @param {Function} fn The callback function to be executed. Typical format: function(cls, data, fn) { // Your code here // Execute this when the processing is finished. // Asynchronous processing is perfectly ok if (fn) { fn.call(this, cls, data); } }); Passed arguments for this function are: * - `{Function} cls`: The created class - `{Object} data`: The set of properties passed in {@link Ext.Class} constructor - `{Function} fn`: The callback function that must to be executed when this pre-processor finishes, regardless of whether the processing is synchronous or aynchronous * @private @return {Ext.Class} this @markdown
removeNode(HtmlElement)
repaint() Repaints the whole page. This fixes frequently encountered painting issues in mobile Safari.
setDefaultPreprocessorPosition(JsString, JsString, JsString) Insert this pre-processor at a specific position in the stack, optionally relative to any existing pre-processor. For example: Ext.Class.registerPreprocessor('debug', function(cls, data, fn) { // Your code here if (fn) { fn.call(this, cls, data); } }).insertDefaultPreprocessor('debug', 'last'); @private @param {String} name The pre-processor name. Note that it needs to be registered with {@link Ext#registerPreprocessor registerPreprocessor} before this @param {String} offset The insertion position. Four possible values are: 'first', 'last', or: 'before', 'after' (relative to the name provided in the third argument) @param {String} relativeName @return {Ext.Class} this @markdown
setDefaultPreprocessors(JsArray) Set the default array stack of default pre-processors * @private @param {Array} preprocessors @return {Ext.Class} this
setup(object)
setVersion(JsString, object) Set version number for the given package name. * @param {String} packageName The package name, for example: 'core', 'touch', 'extjs' @param {String/Ext.Version} version The version, for example: '1.2.3alpha', '2.4.0-dev' @return {Ext}
toArray() @method @member Ext @alias Ext.Array#toArray
triggerReady() @private
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 * @param {Object} value @return {String} @markdown
urlDecode() A convenient alias method for {@link Ext.Object#fromQueryString} * @member Ext @method urlDecode @deprecated 4.0.0 Use {@link Ext.Object#fromQueryString Ext.Object.fromQueryString} instead
urlEncode() A convenient alias method for {@link Ext.Object#toQueryString} * @member Ext @method urlEncode @deprecated 4.0.0 Use {@link Ext.Object#toQueryString Ext.Object.toQueryString} instead
valueFrom(object, object, bool) Returns the given value itself if it's not empty, as described in {@link Ext#isEmpty}; returns the default value (second argument) otherwise. * @param {Object} value The value to test @param {Object} defaultValue The value to return if the original value is empty @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false) @return {Object} value, if non-empty, else defaultValue
widget(object) Convenient shorthand to create a widget by its xtype, also see {@link 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') @member Ext @method widget @markdown

Properties

Name Description
DefaultPreprocessors Retrieve the array stack of default pre-processors @private @return {Function} defaultPreprocessors Set the default array stack of default pre-processors * @private @param {Array} preprocessors @return {Ext.Class} this
idSeed @private
isReady True when the document is fully initialized and ready for action @type Boolean
lastRegisteredVersion @private
up
© Copyright 2005-2011 SharpKit. All rights reserved.