class type t =object
..end
method _BLANK_IMAGE_URL : Js.js_string Js.t Js.prop
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.
method _SSL_SECURE_URL : Js.js_string Js.t Js.prop
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:""'
).
method _USE_NATIVE_JSON : bool Js.t Js.prop
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
method chromeVersion : Js.number Js.t Js.prop
The current version of Chrome (0 if the browser is not Chrome).
method emptyFn : 'a. 'a Js.callback Js.prop
A reusable empty function
method emptyString : 'b. 'b Js.t Js.prop
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.
method enableFx : bool Js.t Js.prop
True if the Ext.fx.Anim Class is available.
method enableGarbageCollector : bool Js.t Js.prop
True to automatically uncache orphaned Ext.Elements periodically
Defaults to: true
method enableListenerCollection : bool Js.t Js.prop
True to automatically purge event listeners during garbageCollection.
Defaults to: true
method enableNestedListenerRemoval : bool Js.t Js.prop
Experimental. True to cascade listener removal to child elements when an element is removed. Currently not optimized for performance.
Defaults to: false
method enumerables : Js.js_string Js.t Js.js_array Js.t Js.prop
An array containing extra enumerables for old browsers
method firefoxVersion : Js.number Js.t Js.prop
The current version of Firefox (0 if the browser is not Firefox).
method globalEvents : Ext_util_Observable.t Js.t Js.prop
An instance of Ext.util.Observable
through which Ext fires global events.
This Observable instance fires the following events:
idle
Fires when an event handler finishes its run, just before returning to browser control.
This includes DOM event handlers, Ajax (including JSONP) event handlers, and TaskRunners
This can be useful for performing cleanup, or update tasks which need to happen only after all code in an event handler has been run, but which should not be executed in a timer due to the intervening browser reflow/repaint which would take place.
ready
Fires when the DOM is ready, and all required classes have been loaded. Functionally
the same as onReady, but must be called with the single
option:
Ext.on({
ready: function() {
console.log('document is ready!');
},
single: true
});
resumelayouts
Fires after global layout processing has been resumed in Ext.AbstractComponent.resumeLayouts.
method ieVersion : Js.number Js.t Js.prop
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)
method isChrome : bool Js.t Js.prop
True if the detected browser is Chrome.
method isFF10 : bool Js.t Js.prop
True if the detected browser uses FireFox 10
method isFF3_0 : bool Js.t Js.prop
True if the detected browser uses FireFox 3.0
method isFF3_5 : bool Js.t Js.prop
True if the detected browser uses FireFox 3.5
method isFF3_6 : bool Js.t Js.prop
True if the detected browser uses FireFox 3.6
method isFF4 : bool Js.t Js.prop
True if the detected browser uses FireFox 4
method isFF5 : bool Js.t Js.prop
True if the detected browser uses FireFox 5
method isGecko : bool Js.t Js.prop
True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox).
method isGecko10 : bool Js.t Js.prop
True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
method isGecko3 : bool Js.t Js.prop
True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x).
method isGecko4 : bool Js.t Js.prop
True if the detected browser uses a Gecko 2.0+ layout engine (e.g. Firefox 4.x).
method isGecko5 : bool Js.t Js.prop
True if the detected browser uses a Gecko 5.0+ layout engine (e.g. Firefox 5.x).
method isIE : bool Js.t Js.prop
True if the detected browser is Internet Explorer.
method isIE10 : bool Js.t Js.prop
True if the detected browser is Internet Explorer 10.x.
method isIE10m : bool Js.t Js.prop
True if the detected browser is Internet Explorer 10.x or lower.
method isIE10p : bool Js.t Js.prop
True if the detected browser is Internet Explorer 10.x or higher.
method isIE6 : bool Js.t Js.prop
True if the detected browser is Internet Explorer 6.x.
method isIE7 : bool Js.t Js.prop
True if the detected browser is Internet Explorer 7.x.
method isIE7m : bool Js.t Js.prop
True if the detected browser is Internet Explorer 7.x or lower.
method isIE7p : bool Js.t Js.prop
True if the detected browser is Internet Explorer 7.x or higher.
method isIE8 : bool Js.t Js.prop
True if the detected browser is Internet Explorer 8.x.
method isIE8m : bool Js.t Js.prop
True if the detected browser is Internet Explorer 8.x or lower.
method isIE8p : bool Js.t Js.prop
True if the detected browser is Internet Explorer 8.x or higher.
method isIE9 : bool Js.t Js.prop
True if the detected browser is Internet Explorer 9.x.
method isIE9m : bool Js.t Js.prop
True if the detected browser is Internet Explorer 9.x or lower.
method isIE9p : bool Js.t Js.prop
True if the detected browser is Internet Explorer 9.x or higher.
method isLinux : bool Js.t Js.prop
True if the detected platform is Linux.
method isMac : bool Js.t Js.prop
True if the detected platform is Mac OS.
method isOpera : bool Js.t Js.prop
True if the detected browser is Opera.
method isOpera10_5 : bool Js.t Js.prop
True if the detected browser is Opera 10.5x.
method isReady : bool Js.t Js.prop
True when the document is fully initialized and ready for action
Defaults to: false
method isSafari : bool Js.t Js.prop
True if the detected browser is Safari.
method isSafari2 : bool Js.t Js.prop
True if the detected browser is Safari 2.x.
method isSafari3 : bool Js.t Js.prop
True if the detected browser is Safari 3.x.
method isSafari4 : bool Js.t Js.prop
True if the detected browser is Safari 4.x.
method isSafari5 : bool Js.t Js.prop
True if the detected browser is Safari 5.x.
method isSafari5_0 : bool Js.t Js.prop
True if the detected browser is Safari 5.0.x.
method isSecure : bool Js.t Js.prop
True if the page is running over SSL
method isWebKit : bool Js.t Js.prop
True if the detected browser uses WebKit.
method isWindows : bool Js.t Js.prop
True if the detected platform is Windows.
method name : Js.js_string Js.t Js.prop
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'
method operaVersion : Js.number Js.t Js.prop
The current version of Opera (0 if the browser is not Opera).
method safariVersion : Js.number Js.t Js.prop
The current version of Safari (0 if the browser is not Safari).
method useShims : bool Js.t Js.prop
By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash, you may want to set this to true.
method webKitVersion : Js.number Js.t Js.prop
The current version of WebKit (0 if the browser does not use WebKit).
method addBehaviors : 'c. 'c Js.t -> unit Js.meth
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:
_ Js.t
The list of behaviors to apply
method addNamespaces : 'd. 'd Js.t -> unit Js.meth
Adds namespace(s) to known list.
Parameters:
_ Js.t
method application : 'e. 'e Js.t -> unit Js.meth
Loads Ext.app.Application class and starts it up with given configuration after the page is ready.
See Ext.app.Application
for details.
Parameters:
_ Js.t
Application config object or name of a class derived from Ext.app.Application.
method apply : 'f 'g 'h 'i. 'f Js.t -> 'g Js.t -> 'h Js.t Js.optdef -> 'i Js.t Js.meth
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.
Parameters:
_ Js.t
The receiver of the properties
_ Js.t
The source of the properties
_ Js.t
(optional)
A different object that will also be applied for default values
Returns:
_ Js.t
returns obj
method applyIf : 'j 'k 'l. 'j Js.t -> 'k Js.t -> 'l Js.t Js.meth
Copies all the properties of config to object if they don't already exist.
Parameters:
_ Js.t
The receiver of the properties
_ Js.t
The source of the properties
Returns:
_ Js.t
returns obj
method batchLayouts : 'm 'n. 'm Js.callback -> 'n Js.t Js.optdef -> unit Js.meth
Utility wrapper that suspends layouts of all components for the duration of a given function.
Parameters:
_ Js.callback
The function to execute.
_ Js.t
(optional)
The scope (this
reference) in which the specified function is executed.
method bind : 'o 'p 'q 'r 's.
'o Js.callback ->
'p Js.t Js.optdef ->
'q Js.js_array Js.t Js.optdef ->
'r Js.t Js.optdef -> 's Js.callback Js.meth
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
Parameters:
_ Js.callback
The function to delegate.
_ Js.t
(optional)
The scope (this
reference) in which the function is executed.
If omitted, defaults to the default global environment object (usually the browser window).
_ Js.js_array Js.t
(optional)
Overrides arguments for the call. (Defaults to the arguments passed by the caller)
_ Js.t
(optional)
if True args are appended to call args instead of overriding, if a number the args are inserted at the specified position
Returns:
_ Js.callback
The new function
method callback : 't 'u 'v 'w.
't Js.callback ->
'u Js.t Js.optdef ->
'v Js.js_array Js.t Js.optdef ->
Js.number Js.t Js.optdef -> 'w Js.t Js.meth
Execute a callback function in a particular scope. If callback
argument is a
function reference, that is called. If it is a string, the string is assumed to
be the name of a method on the given scope
. If no function is passed the call
is ignored.
For example, these calls are equivalent:
var myFunc = this.myFunc;
Ext.callback('myFunc', this, [arg1, arg2]);
Ext.callback(myFunc, this, [arg1, arg2]);
Ext.isFunction(myFunc) && this.myFunc(arg1, arg2);
Parameters:
_ Js.callback
The callback to execute
_ Js.t
(optional)
The scope to execute in
_ Js.js_array Js.t
(optional)
The arguments to pass to the function
Js.number Js.t
(optional)
Pass a number to delay the call by a number of milliseconds.
Returns:
_ Js.t
The value returned by the callback or undefined
(if there is a delay
or if the callback
is not a function).
method clone : 'x 'y. 'x Js.t -> 'y Js.t Js.meth
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.
Parameters:
_ Js.t
The variable to clone
Returns:
_ Js.t
clone
method coerce : 'z 'a1 'b1. 'z Js.t -> 'a1 Js.t -> 'b1 Js.t Js.meth
Coerces the first value if possible so that it is comparable to the second value.
Coercion only works between the basic atomic data types String, Boolean, Number, Date, null and undefined.
Numbers and numeric strings are coerced to Dates using the value as the millisecond era value.
Strings are coerced to Dates by parsing using the defaultFormat.
For example
Ext.coerce('false', true);
returns the boolean value false
because the second parameter is of type Boolean
.
Parameters:
_ Js.t
The value to coerce
_ Js.t
The value it must be compared against
Returns:
_ Js.t
The coerced value.
method copyTo : 'c1 'd1 'e1 'f1.
'c1 Js.t -> 'd1 Js.t -> 'e1 Js.t -> bool Js.t Js.optdef -> 'f1 Js.t Js.meth
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.
Parameters:
_ Js.t
The destination object.
_ Js.t
The source object.
_ Js.t
Either an Array of property names, or a comma-delimited list of property names to copy.
bool Js.t
(optional)
Defaults to false. Pass true to copy keys off of the prototype as well as the instance.
Returns:
_ Js.t
The modified object.
method create : 'g1 'h1.
Js.js_string Js.t Js.optdef -> 'g1 Js.t Js.optdef -> 'h1 Js.t Js.meth
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,
...
});
Parameters:
Js.js_string Js.t
(optional)
The class name or alias. Can be specified as xclass
property if only one object parameter is specified.
_ Js.t
(optional)
Additional arguments after the name will be passed to the class' constructor.
Returns:
_ Js.t
instance
method createByAlias : 'i1 'j1. Js.js_string Js.t -> 'i1 Js.t -> 'j1 Js.t Js.meth
Instantiate a class by its alias.
Ext.ClassManager.instantiateByAlias is usually invoked by the shorthand createByAlias.
If Ext.Loader is enabled and the class has not been defined yet, it will attempt to load the class via synchronous loading.
var window = Ext.createByAlias('widget.window', { width: 600, height: 800, ... });
Parameters:
Js.js_string Js.t
_ Js.t
method decode : 'k1. Js.js_string Js.t -> bool Js.t Js.optdef -> 'k1 Js.t Js.meth
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.
Parameters:
Js.js_string Js.t
The JSON string
bool Js.t
(optional)
True to return null, false to throw an exception if the JSON is invalid.
Defaults to: falseReturns:
_ Js.t
The resulting object
method defer : 'l1 'm1 'n1 'o1.
'l1 Js.callback ->
Js.number Js.t ->
'm1 Js.t Js.optdef ->
'n1 Js.js_array Js.t Js.optdef ->
'o1 Js.t Js.optdef -> Js.number Js.t Js.meth
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
Parameters:
_ Js.callback
The function to defer.
Js.number Js.t
The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately)
_ Js.t
(optional)
The scope (this
reference) in which the function is executed.
If omitted, defaults to the browser window.
_ Js.js_array Js.t
(optional)
Overrides arguments for the call. (Defaults to the arguments passed by the caller)
_ Js.t
(optional)
if True args are appended to call args instead of overriding, if a number the args are inserted at the specified position
Returns:
Js.number Js.t
The timeout id that can be used with clearTimeout
method define : 'p1 'q1 'r1.
Js.js_string Js.t ->
'p1 Js.t -> 'q1 Js.callback -> (#Ext_Base.t as 'r1) Js.t Js.meth
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;
}
};
});
Note that when using override, the above syntax will not override successfully, because the passed function would need to be executed first to determine whether or not the result is an override or defining a new object. As such, an alternative syntax that immediately invokes the function can be used:
Ext.define('MyApp.override.BaseOverride', function () {
var counter = 0;
return {
override: 'Ext.Component',
logId: function () {
console.log(++counter, this.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.
Parameters:
Js.js_string Js.t
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
Pass null
to create an anonymous class.
_ Js.t
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
_ Js.callback
Optional callback to execute after the class is created, the execution scope of which
(this
) will be the newly created class itself.
method deprecate : 's1 't1.
Js.js_string Js.t ->
Js.js_string Js.t -> 's1 Js.callback -> 't1 Js.t -> unit Js.meth
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;
...
});
Parameters:
Js.js_string Js.t
The package name
Js.js_string Js.t
The last version before it's deprecated
_ Js.callback
The callback function to be executed with the specified version is less than the current version
_ Js.t
The execution scope (this
) if the closure
method destroy : 'u1. 'u1 Js.t -> unit Js.meth
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.
Parameters:
_ Js.t
Any number of elements or components, or an Array of either of these to destroy.
method destroyMembers : 'v1. 'v1 Js.t -> Js.js_string Js.t -> unit Js.meth
Attempts to destroy and then remove a set of named properties of the passed object.
Parameters:
_ Js.t
The object (most likely a Component) who's properties you wish to destroy.
Js.js_string Js.t
One or more names of the properties to destroy and remove from the object.
method each : 'w1 'x1 'y1.
'w1 Js.t ->
'x1 Js.callback ->
'y1 Js.t Js.optdef -> bool Js.t Js.optdef -> bool Js.t Js.meth
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
Parameters:
_ Js.t
The value to be iterated. If this argument is not iterable, the callback function is called once.
_ Js.callback
The callback function. If it returns false, the iteration stops and this method returns
the current index
.
_ Js.t
(optional)
The scope (this
reference) in which the specified function is executed.
bool Js.t
(optional)
Reverse the iteration order (loop from the end to the beginning) Defaults false
Returns:
bool Js.t
See description for the fn
parameter.
method encode : 'z1. 'z1 Js.t -> Js.js_string Js.t Js.meth
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.
Parameters:
_ Js.t
The variable to encode
Returns:
Js.js_string Js.t
The JSON string
method exclude : 'a2 'b2. 'a2 Js.js_array Js.t -> 'b2 Js.t Js.meth
Convenient shortcut to Ext.Loader.exclude
Explicitly exclude files from being loaded. Useful when used in conjunction with a broad include expression.
Can be chained with more require
and exclude
methods, eg:
Ext.exclude('Ext.data.*').require('*');
Ext.exclude('widget.button*').require('widget.*');
exclude is alias for Ext.Loader.exclude.
Parameters:
_ Js.js_array Js.t
method fly : 'c2.
'c2 Js.t ->
Js.js_string Js.t Js.optdef -> Ext_dom_Element_Fly.t Js.t Js.meth
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.
Parameters:
_ Js.t
The dom node or id
Js.js_string Js.t
(optional)
Allows for creation of named reusable flyweights to prevent conflicts (e.g. internally Ext uses "_global")
Returns:
Ext_dom_Element_Fly.t Js.t
The singleton flyweight object (or null if no matching element was found)
method get : 'd2. 'd2 Js.t -> Ext_dom_Element.t Js.t Js.meth
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.
When passing an id, it should not include the #
character that is used for a css selector.
// For an element with id 'foo'
Ext.get('foo'); // Correct
Ext.get('#foo'); // Incorrect
Uses simple caching to consistently return the same object. Automatically fixes if an object was recreated with the same id via AJAX or DOM.
Parameters:
_ Js.t
The id of the node, a DOM Node or an existing Element.
Returns:
Ext_dom_Element.t Js.t
The Element object (or null if no matching element was found)
method getBody : Ext_dom_Element.t Js.t Js.meth
Returns the current document body as an Ext.Element.
method getClass : 'e2. 'e2 Js.t -> Ext_Class.t Js.t Js.meth
Get the class of the provided object; returns null if it's not an instance of any class created with Ext.define.
Ext.ClassManager.getClass is usually invoked by the shorthand getClass.
var component = new Ext.Component();
Ext.getClass(component); // returns Ext.Component
Parameters:
_ Js.t
method getClassName : 'f2. 'f2 Js.t -> Js.js_string Js.t Js.meth
Get the name of the class by its reference or its instance;
Ext.ClassManager.getName is usually invoked by the shorthand getClassName.
Ext.getName(Ext.Action); // returns "Ext.Action"
Parameters:
_ Js.t
method getCmp : 'g2. Js.js_string Js.t -> 'g2 Js.t Js.meth
This is shorthand reference to Ext.ComponentManager.get. Looks up an existing Component by id
Parameters:
Js.js_string Js.t
The component id
method getDoc : Ext_dom_Element.t Js.t Js.meth
Returns the current HTML document object as an Ext.Element.
method getDom : 'h2 'i2. 'h2 Js.t -> 'i2 Js.t Js.meth
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.
Parameters:
_ Js.t
Returns:
_ Js.t
HTMLElement
method getHead : Ext_dom_Element.t Js.t Js.meth
Returns the current document head as an Ext.Element.
method getNamespace : Js.js_string Js.t -> Js.js_string Js.t Js.meth
Get namespace prefix for a class name.
Parameters:
Js.js_string Js.t
Returns:
Js.js_string Js.t
Namespace prefix if it's known, otherwise undefined
method getOrientation : Js.js_string Js.t Js.meth
Returns the current orientation of the mobile device
Returns:
Js.js_string Js.t
Either 'portrait' or 'landscape'
method getScrollbarSize : 'j2. bool Js.t Js.optdef -> 'j2 Js.t Js.meth
Returns the size of the browser scrollbars. This can differ depending on operating system settings, such as the theme or font size.
Parameters:
bool Js.t
(optional)
true to force a recalculation of the value.
Returns:
_ Js.t
An object containing scrollbar sizes.
method getStore : 'k2. 'k2 Js.t -> Ext_data_Store.t Js.t Js.meth
Shortcut to Ext.data.StoreManager.lookup.
Gets a registered Store by id
Parameters:
_ Js.t
The id of the Store, or a Store instance, or a store configuration
method getVersion : Js.js_string Js.t Js.optdef -> Ext_Version.t Js.t Js.meth
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.
Parameters:
Js.js_string Js.t
(optional)
The package name, for example: 'core', 'touch', 'extjs'
Returns:
Ext_Version.t Js.t
The version
method id : 'l2.
'l2 Js.t Js.optdef ->
Js.js_string Js.t Js.optdef -> Js.js_string Js.t Js.meth
Generates unique ids. If the element already has an id, it is unchanged
Parameters:
_ Js.t
(optional)
The element to generate an id for
Js.js_string Js.t
(optional)
Id prefix (defaults "ext-gen")
Returns:
Js.js_string Js.t
The generated Id.
method identityFn : 'm2. 'm2 Js.t -> unit Js.meth
A reusable identity function. The function will always return the first argument, unchanged.
Parameters:
_ Js.t
method isArray : 'n2. 'n2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a JavaScript Array, false otherwise.
Parameters:
_ Js.t
The target to test
method isBoolean : 'o2. 'o2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a boolean.
Parameters:
_ Js.t
The value to test
method isDate : 'p2. 'p2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a JavaScript Date object, false otherwise.
Parameters:
_ Js.t
The object to test
method isDefined : 'q2. 'q2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is defined.
Parameters:
_ Js.t
The value to test
method isElement : 'r2. 'r2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is an HTMLElement
Parameters:
_ Js.t
The value to test
method isEmpty : 's2. 's2 Js.t -> bool Js.t Js.optdef -> bool Js.t Js.meth
Returns true if the passed value is empty, false otherwise. The value is deemed to be empty if it is either:
null
undefined
allowEmptyString
parameter is set to true
)Parameters:
_ Js.t
The value to test
bool Js.t
(optional)
true to allow empty strings (defaults to false)
method isFunction : 't2. 't2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a JavaScript Function, false otherwise.
Parameters:
_ Js.t
The value to test
method isIterable : 'u2. 'u2 Js.t -> bool Js.t Js.meth
Returns true
if the passed value is iterable, that is, if elements of it are addressable using array
notation with numeric indices, false
otherwise.
Arrays and function arguments
objects are iterable. Also HTML collections such as NodeList
and `HTMLCollection'
are iterable.
Parameters:
_ Js.t
The value to test
method isNumber : 'v2. 'v2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a number. Returns false for non-finite numbers.
Parameters:
_ Js.t
The value to test
method isNumeric : 'w2. 'w2 Js.t -> bool Js.t Js.meth
Validates that a value is numeric.
Parameters:
_ Js.t
Examples: 1, '1', '2.34'
Returns:
bool Js.t
True if numeric, false otherwise
method isObject : 'x2. 'x2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a JavaScript Object, false otherwise.
Parameters:
_ Js.t
The value to test
method isPrimitive : 'y2. 'y2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean.
Parameters:
_ Js.t
The value to test
method isString : 'z2. 'z2 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a string.
Parameters:
_ Js.t
The value to test
method isTextNode : 'a3. 'a3 Js.t -> bool Js.t Js.meth
Returns true if the passed value is a TextNode
Parameters:
_ Js.t
The value to test
method iterate : 'b3 'c3 'd3.
'b3 Js.t -> 'c3 Js.callback -> 'd3 Js.t Js.optdef -> unit Js.meth
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.
Parameters:
_ Js.t
The object or array to be iterated.
_ Js.callback
The function to be called for each iteration. See and Ext.Array.each and Ext.Object.each for detailed lists of arguments passed to this function depending on the given object type that is being iterated.
_ Js.t
(optional)
The scope (this
reference) in which the specified function is executed.
Defaults to the object being iterated itself.
method log : 'e3. 'e3 Js.t Js.optdef -> Js.js_string Js.t Js.optdef -> unit Js.meth
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.
Parameters:
_ Js.t
(optional)
The message to log or an options object with any of the following properties:
msg
: The message to log (required).level
: One of: "error", "warn", "info" or "log" (the default is "log").dump
: An object to dump to the log as part of the message.stack
: True to include a stack trace in the log.indent
: Cause subsequent log statements to be indented one step.outdent
: Cause this and following statements to be one step less indented.Js.js_string Js.t
(optional)
The message to log (required unless specified in options object).
method merge : 'f3 'g3 'h3. 'f3 Js.t -> 'g3 Js.t -> 'h3 Js.t Js.meth
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
}
}
Parameters:
_ Js.t
The object into which all subsequent objects are merged.
_ Js.t
Any number of objects to merge into the destination.
Returns:
_ Js.t
merged The destination object with all passed objects merged in.
method namespace : 'i3. Js.js_string Js.t -> 'i3 Js.t Js.meth
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) { ... };
Parameters:
Js.js_string Js.t
Returns:
_ Js.t
The namespace object. (If multiple arguments are passed, this will be the last namespace created)
method ns : 'j3. Js.js_string Js.t -> 'j3 Js.t Js.meth
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) { ... };
Parameters:
Js.js_string Js.t
Returns:
_ Js.t
The namespace object. (If multiple arguments are passed, this will be the last namespace created)
method on : 'k3 'l3 'm3 'n3 'o3.
'k3 Js.t ->
'l3 Js.callback Js.optdef ->
'm3 Js.t Js.optdef -> 'n3 Js.t Js.optdef -> 'o3 Js.t Js.meth
Shorthand for the Ext.util.Observable.addListener method of the globalEvents Observable instance.
Appends an event handler to this object. For example:
myGridPanel.on("mouseover", this.onMouseOver, this);
The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:
myGridPanel.on({
cellClick: this.onCellClick,
mouseover: this.onMouseOver,
mouseout: this.onMouseOut,
scope: this // Important. Ensure "this" is correct during handler execution
});
One can also specify options for each event handler separately:
myGridPanel.on({
cellClick: {fn: this.onCellClick, scope: this, single: true},
mouseover: {fn: panel.onMouseOver, scope: panel}
});
Names of methods in a specified scope may also be used. Note that
scope
MUST be specified to use this option:
myGridPanel.on({
cellClick: {fn: 'onCellClick', scope: this, single: true},
mouseover: {fn: 'onMouseOver', scope: panel}
});
Parameters:
_ Js.t
The name of the event to listen for. May also be an object who's property names are event names.
_ Js.callback
(optional)
The method the event invokes, or if scope
is specified, the name* of the method within
the specified scope
. Will be called with arguments
given to fireEvent plus the options
parameter described below.
_ Js.t
(optional)
The scope (this
reference) in which the handler function is
executed. If omitted, defaults to the object which fired the event.
_ Js.t
(optional)
An object containing handler configuration.
Note: Unlike in ExtJS 3.x, the options object will also be passed as the last argument to every event handler.
This object may contain any of the following properties:
Returns:
_ Js.t
Only when the destroyable
option is specified.
A Destroyable
object. An object which implements the destroy
method which removes all listeners added in this call. For example:
this.btnListeners = = myButton.on({
destroyable: true
mouseover: function() { console.log('mouseover'); },
mouseout: function() { console.log('mouseout'); },
click: function() { console.log('click'); }
});
And when those listeners need to be removed:
Ext.destroy(this.btnListeners);
or
this.btnListeners.destroy();
method onDocumentReady : 'p3 'q3 'r3.
'p3 Js.callback -> 'q3 Js.t Js.optdef -> 'r3 Js.t Js.optdef -> unit Js.meth
Adds a listener to be notified when the document is ready (before onload and before images are loaded).
onDocumentReady is an alias for Ext.EventManager.onDocumentReady.
Parameters:
_ Js.callback
_ Js.t
(optional)
_ Js.t
(optional)
method onReady : 's3 't3 'u3. 's3 Js.callback -> 't3 Js.t -> 'u3 Js.t -> unit Js.meth
Adds a function to be called when the DOM is ready, and all required classes have been loaded.
If the DOM is ready and all classes are loaded, the passed function is executed immediately.
Parameters:
_ Js.callback
_ Js.t
_ Js.t
method override : 'v3 'w3. 'v3 Js.t -> 'w3 Js.t -> unit Js.meth
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.
Parameters:
_ Js.t
The target to override.
_ Js.t
The properties to add or replace on target
.
method pass : 'x3 'y3 'z3 'a4.
'x3 Js.callback ->
'y3 Js.js_array Js.t -> 'z3 Js.t Js.optdef -> 'a4 Js.callback Js.meth
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
Parameters:
_ Js.callback
The original function
_ Js.js_array Js.t
The arguments to pass to new callback
_ Js.t
(optional)
The scope (this
reference) in which the function is executed.
Returns:
_ Js.callback
The new callback function
method preg : 'b4. Js.js_string Js.t -> 'b4 Js.callback -> unit Js.meth
Shorthand for Ext.PluginManager.registerType
Parameters:
Js.js_string Js.t
The ptype mnemonic string by which the Plugin class may be looked up.
_ Js.callback
The new Plugin class.
method query : Js.js_string Js.t ->
Dom_html.element Js.t Js.optdef ->
Js.js_string Js.t Js.optdef ->
bool Js.t Js.optdef -> Dom_html.element Js.t Js.js_array Js.t Js.meth
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.
Parameters:
Js.js_string Js.t
The selector/xpath query
Dom_html.element Js.t
(optional)
The start of the query.
Defaults to: documentJs.js_string Js.t
(optional)
Either "select" or "simple" for a simple selector match (only valid when used when the call is deferred to the jsSelect method)
Defaults to: "select"bool Js.t
(optional)
Pass true
to select only the first matching node using document.querySelector
(where available)
Returns:
Dom_html.element Js.t Js.js_array Js.t
An array of DOM elements (not a NodeList as returned by querySelectorAll
).
method regStore : 'c4. Js.js_string Js.t -> 'c4 Js.t -> unit Js.meth
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
});
Parameters:
Js.js_string Js.t
The id to set on the new store
_ Js.t
The store config
method removeNode : Dom_html.element Js.t -> unit Js.meth
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:
Dom_html.element Js.t
The node to remove
method require : 'd4 'e4 'f4 'g4.
'd4 Js.t ->
'e4 Js.callback Js.optdef ->
'f4 Js.t Js.optdef -> 'g4 Js.t Js.optdef -> unit Js.meth
Loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when finishes, within the optional scope.
require is alias for Ext.Loader.require.
Parameters:
_ Js.t
_ Js.callback
(optional)
_ Js.t
(optional)
_ Js.t
(optional)
method resumeLayouts : 'h4. 'h4 Js.t -> unit Js.meth
method select : Js.js_string Js.t ->
bool Js.t Js.optdef -> Ext_dom_CompositeElement.t Js.t Js.meth
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).
Defined in override Ext.dom.AbstractElement_traversal.
Parameters:
Js.js_string Js.t
The CSS selector
bool Js.t
(optional)
True to create a unique Ext.Element for each element. Defaults to a shared flyweight object.
Returns:
Ext_dom_CompositeElement.t Js.t
The composite element
method setGlyphFontFamily : Js.js_string Js.t -> unit Js.meth
Sets the default font-family to use for components that support a glyph
config.
Parameters:
Js.js_string Js.t
The name of the font-family
method setVersion : 'i4 'j4. Js.js_string Js.t -> 'i4 Js.t -> 'j4 Js.t Js.meth
Set version number for the given package name.
Parameters:
Js.js_string Js.t
The package name, for example: 'core', 'touch', 'extjs'
_ Js.t
The version, for example: '1.2.3alpha', '2.4.0-dev'
method suspendLayouts : unit Js.meth
method syncRequire : 'k4 'l4 'm4 'n4.
'k4 Js.t ->
'l4 Js.callback Js.optdef ->
'm4 Js.t Js.optdef -> 'n4 Js.t Js.optdef -> unit Js.meth
Synchronously loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when finishes, within the optional scope.
syncRequire is alias for Ext.Loader.syncRequire.
Parameters:
_ Js.t
_ Js.callback
(optional)
_ Js.t
(optional)
_ Js.t
(optional)
method toArray : 'o4 'p4.
'o4 Js.t ->
Js.number Js.t Js.optdef ->
Js.number Js.t Js.optdef -> 'p4 Js.js_array Js.t Js.meth
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
Parameters:
_ Js.t
the iterable object to be turned into a true Array.
Js.number Js.t
(optional)
a zero-based index that specifies the start of extraction. Defaults to 0
Js.number Js.t
(optional)
a 1-based index that specifies the end of extraction. Defaults to the last index of the iterable value
Returns:
_ Js.js_array Js.t
array
method typeOf : 'q4. 'q4 Js.t -> Js.js_string Js.t Js.meth
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 stringnumber
: If the given value is a numberboolean
: If the given value is a boolean valuedate
: If the given value is a Date
objectfunction
: If the given value is a function referenceobject
: If the given value is an objectarray
: If the given value is an arrayregexp
: If the given value is a regular expressionelement
: If the given value is a DOM Elementtextnode
: If the given value is a DOM text node and contains something other than whitespacewhitespace
: If the given value is a DOM text node and contains only whitespaceParameters:
_ Js.t
method un : 'r4 's4.
Js.js_string Js.t -> 'r4 Js.callback -> 's4 Js.t Js.optdef -> unit Js.meth
Shorthand for the Ext.util.Observable.removeListener method of the globalEvents Observable instance.
Removes an event handler.
Parameters:
Js.js_string Js.t
The type of event the handler was associated with.
_ Js.callback
The handler to remove. This must be a reference to the function passed into the addListener call.
_ Js.t
(optional)
The scope originally specified for the handler. It must be the same as the scope argument specified in the original call to addListener or the listener will not be removed.
method valueFrom : 't4 'u4 'v4. 't4 Js.t -> 'u4 Js.t -> bool Js.t Js.optdef -> 'v4 Js.t Js.meth
Returns the given value itself if it's not empty, as described in isEmpty; returns the default value (second argument) otherwise.
Parameters:
_ Js.t
The value to test
_ Js.t
The value to return if the original value is empty
bool Js.t
(optional)
true to allow zero length strings to qualify as non-empty (defaults to false)
Returns:
_ Js.t
value, if non-empty, else defaultValue
method widget : 'w4 'x4.
Js.js_string Js.t Js.optdef -> 'w4 Js.t Js.optdef -> 'x4 Js.t Js.meth
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.
Parameters:
Js.js_string Js.t
(optional)
The xtype of the widget to create.
_ Js.t
(optional)
The configuration object for the widget constructor.
Returns:
_ Js.t
The widget instance