Many classes have shortcut names used when creating (instantiating) a class with a
configuration object. The shortcut name is referred to as an alias
(or xtype
if the
class extends Ext.Component). The alias/xtype is listed next to the class name of
applicable classes for quick reference.
Framework classes or their members may be specified as private
or protected
. Else,
the class / member is public
. Public
, protected
, and private
are access
descriptors used to convey how and when the class or class member should be used.
Public classes and class members are available for use by any other class or application code and may be relied upon as a stable and persistent within major product versions. Public classes and members may safely be extended via a subclass.
Protected class members are stable public
members intended to be used by the
owning class or its subclasses. Protected members may safely be extended via a subclass.
Private classes and class members are used internally by the framework and are not intended to be used by application developers. Private classes and members may change or be omitted from the framework at any time without notice and should not be relied upon in application logic.
static
label next to the
method name. *See Static below.Below is an example class member that we can disect to show the syntax of a class member (the lookupComponent method as viewed from the Ext.button.Button class in this case).
Let's look at each part of the member row:
lookupComponent
in this example)( item )
in this example)Ext.Component
in this case). This may be omitted for methods that do not
return anything other than undefined
or may display as multiple possible values
separated by a forward slash /
signifying that what is returned may depend on the
results of the method call (i.e. a method may return a Component if a get method calls is
successful or false
if unsuccessful which would be displayed as
Ext.Component/Boolean
).PROTECTED
in
this example - see the Flags section below)Ext.container.Container
in this example). The source
class will be displayed as a blue link if the member originates from the current class
and gray if it is inherited from an ancestor or mixed-in class.view source
in the example)item : Object
in the example).undefined
a "Returns" section
will note the type of class or object returned and a description (Ext.Component
in the
example)Available since 3.4.0
- not pictured in
the example) just after the member descriptionDefaults to: false
)The API documentation uses a number of flags to further commnicate the class member's function and intent. The label may be represented by a text label, an abbreviation, or an icon.
classInstance.method1().method2().etc();
false
is returned from
an event handler- Indicates a framework class
- A singleton framework class. *See the singleton flag for more information
- A component-type framework class (any class within the Ext JS framework that extends Ext.Component)
- Indicates that the class, member, or guide is new in the currently viewed version
- Indicates a class member of type config
- Indicates a class member of type property
- Indicates a class member of type
method
- Indicates a class member of type event
- Indicates a class member of type
theme variable
- Indicates a class member of type
theme mixin
- Indicates that the class, member, or guide is new in the currently viewed version
Just below the class name on an API doc page is a row of buttons corresponding to the types of members owned by the current class. Each button shows a count of members by type (this count is updated as filters are applied). Clicking the button will navigate you to that member section. Hovering over the member-type button will reveal a popup menu of all members of that type for quick navigation.
Getting and setter methods that correlate to a class config option will show up in the methods section as well as in the configs section of both the API doc and the member-type menus just beneath the config they work with. The getter and setter method documentation will be found in the config row for easy reference.
Your page history is kept in localstorage and displayed (using the available real estate) just below the top title bar. By default, the only search results shown are the pages matching the product / version you're currently viewing. You can expand what is displayed by clicking on the button on the right-hand side of the history bar and choosing the "All" radio option. This will show all recent pages in the history bar for all products / versions.
Within the history config menu you will also see a listing of your recent page visits. The results are filtered by the "Current Product / Version" and "All" radio options. Clicking on the button will clear the history bar as well as the history kept in local storage.
If "All" is selected in the history config menu the checkbox option for "Show product details in the history bar" will be enabled. When checked, the product/version for each historic page will show alongside the page name in the history bar. Hovering the cursor over the page names in the history bar will also show the product/version as a tooltip.
Both API docs and guides can be searched for using the search field at the top of the page.
On API doc pages there is also a filter input field that filters the member rows using the filter string. In addition to filtering by string you can filter the class members by access level, inheritance, and read only. This is done using the checkboxes at the top of the page.
The checkbox at the bottom of the API class navigation tree filters the class list to include or exclude private classes.
Clicking on an empty search field will show your last 10 searches for quick navigation.
Each API doc page (with the exception of Javascript primitives pages) has a menu view of metadata relating to that class. This metadata view will have one or more of the following:
Ext.button.Button
class has an alternate class name of Ext.Button
). Alternate class
names are commonly maintained for backward compatibility.Runnable examples (Fiddles) are expanded on a page by default. You can collapse and expand example code blocks individually using the arrow on the top-left of the code block. You can also toggle the collapse state of all examples using the toggle button on the top-right of the page. The toggle-all state will be remembered between page loads.
Class members are collapsed on a page by default. You can expand and collapse members using the arrow icon on the left of the member row or globally using the expand / collapse all toggle button top-right.
Viewing the docs on narrower screens or browsers will result in a view optimized for a smaller form factor. The primary differences between the desktop and "mobile" view are:
The class source can be viewed by clicking on the class name at the top of an API doc page. The source for class members can be viewed by clicking on the "view source" link on the right-hand side of the member row.
Below you'll find answers to the most commonly asked questions regarding Ext JS. If you can't find an answer to your question, please visit the Ext JS forums or file a Support ticket.
You can also check all of our past "Support Tips" on the Sencha Blog for helpful tips and tricks to successfully navigate Ext JS.
If you believe that your question warrants addition to this page, please let us know!
Note: The following FAQ's apply to Ext 5 and higher unless otherwise specified.
Note: Ext JS 5 does not currently support mobile phones
We recommend using the HTML5 doctype. To ensure that Internet Explorer does not activate
Compatibility Mode (compatibility mode is unsupported), we also recommend using the
X-UA-Compatible
meta tag. For example:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
You can build an application without Sencha Cmd by including the Framework, theme CSS,
and your chosen theme's JS override in your index.html
file's head.
The theme's CSS and override files are created as packages in Ext JS. In Ext JS 5 the themes are located within "{ExtJS-5-SDK}/packages/". Themes include:
In Ext JS 6+ the themes are split between the classic and modern toolkits. The classic themes are located within "{ExtJS-7-SDK}/classic/" and include:
Ext JS 7 modern themes are located within "{ExtJS-7-SDK}/modern/" and include:
Note: We do recommend using Sencha Cmd, as the above example includes a very large file that includes everything. When using Sencha Cmd, your application only gets the bits it requires, which keeps it lightweight, responsive, and clean.
The Getting Started guide will walk you through generating your application using Sencha Cmd.
ext.js: Minified. Base framework that dynamically loads extended classes.
ext-all.js: Minified. Includes entire framework.
ext-all-debug.js: Not Minified. Includes entire framework
ext-debug.js: Not Minified. Base framework that dynamically loads extended classes.
ext-all-rtl-debug.js: Not Minified. Includes entire framework and right-to-left support.
ext-all-rtl-sandbox-debug.js: Not Minified. Includes entire framework and right-to-left support. Sandboxed to allow for use alongside other versions of Ext.
ext-all-rtl-sandbox.js: Minified. Includes entire framework and right-to-left support. Sandboxed to allow for use with alongside versions of Ext.
ext-all-rtl.js: Minified. Includes entire framework and right-to-left support.
ext-all-sandbox-debug.js: Not Minified. Includes entire framework sandboxed to allow for use with alongside versions of Ext.
ext-all-sandbox.js: Minified. Includes entire framework sandboxed to allow for use with alongside versions of Ext.
To set an application's theme, simply include the theme package's CSS and JS override in
your index.html's
head. As an example:
<head>
<title>Hello World</title>
<link rel="stylesheet" type="text/css" href="ext/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css">
<script type="text/javascript" src="ext/build/ext-all-debug.js"></script>
<script type="text/javascript" src="ext/packages/ext-theme-neptune/build/ext-theme-neptune.js"></script>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
Yes, any Ext JS 5+ application should properly appear on desktop AND tablets or touch-screen devices with supported browsers. It should be noted that there are generally no extra steps necessary for tablet support.
That said, there are two areas that may need some attention in specific situations. The first will not affect developers who only use Ext JS API event listeners. However, if you are directly attaching listeners, or you are using a 3rd party JavaScript library that directly attaches listeners, issues may occur with the timing of directly attached event handlers. This has to do with some changes made to the event system in order to support touch gestures.
You can find more information about changes regarding event delegation in our events guide and our tablet support guide.
The second scenario deals with mouse events that don't have an obvious analog in the touch world. For instance, there are no touch equivalents for mouseover, mouseout, mousenter, or mouseleave.
It may be necessary to provide an alternate implementation for these interactions if that functionality is critical to your application. This often means substituting the mouse event with an appropriate touch gesture.
The Desktop and Tablet controls aren't currently suited for small screens. Grids, trees, panels, border layouts just require more room for proper display. It may work, but it isn't exactly suitable for smaller screens.
With Ext JS 6, you can author a single, universal application optimized to run on destktop, tablet, and phone devices. The application may contain common event handling logic, stores, and models. The views used will be pulled from the classic toolkit (legacy Ext JS) and the modern toolkit (legacy Sencha Touch) depending on which device profile you're targeting. You can read more about he universal app setup in the Getting Started guide.
Ext JS 5+ and Sencha Touch are not optimized to share controllers, stores, and models.
However, they are shared between the modern and classic toolkits (Touch and
legacy Ext JS views respecively) in Ext JS 6+. Refer to the
Getting Started guide for additional information.
To see removals, additions, deprecations, etc, please check out our diff guides between versions:
Note: We believe developers can glean a lot of useful information by evaluating these diff guides when upgrading their applications. That said, these reports are automated and may not always accurately depict change. Unwanted change may be indicated due to doc updates, formatting omissions, etc. If you see anything in these reports that is incorrect or undesirable, please report them on the forums.
It is faster in some areas. Grid markup was changed in version 5 to use a table-per-row, which makes grid rendering significantly faster.
JS layout for form fields and buttons was eliminated in favor of "liquid" CSS layout. Performance improvements have been seen when using the "form layout" when producing large forms. These types of improvements should help with performance, but there is still work to be done. You can expect further performance improvements in the next release.
Yes, you can use a "sandboxed" build, which changes the top level JS namespace, and the CSS prefix to avoid conflicts. It is important to note that it is not recommended to sandbox two different versions in a production environment as this entails loading two full versions of the Ext JS framework.
This means that you'd be loading twice as many resources as a typical "non-sandboxed" application. Sandbox builds are generally used for migration or for a temporary need to include new features in an old application.
Adding localization to your application is possible via locale-specific overrides, which
can be set in your Sencha Cmd generated app.json
file. Please see the
localization guide for more information.
The preferred way to create an override is as follows:
Ext.define('MyApp.overrides.panel.Panel', {
override: 'Ext.panel.Panel',
close: function() {
console.log('My Change to Close');
this.callParent();
},
helloWorld: function(){
console.log('Hello World');
}
});
1) First, define your override with an appropriate namespace for your application's overrides folder
2) Add the "override" config and give it a value equivalent to the class you are wanting to override. In this example, we're overriding Ext.panel.Panel.
3) Add the function you're looking to override. You'll need to make sure you keep all
of the relevant pieces. In this case, I've only changed the close function by adding a
console.log()
. If you were to create a panel and then do panel.close()
, you will
receive a console message saying, "My Change to Close".
Note: In your overridden method you will need to execute this.callParent()
to call
the original method provided by the target class. To bypass that method and instead skip
up to the superclass implementation (say to avoid a bug in the target class's method)
you can invoke this.callSuper()
instead.
4) Add a new function all together. As you may imagine, Ext.panel.Panel does
not contain a helloWorld
method. However, I've just added it via this override. Now,
creating a panel and issuing panel.helloWorld()
will result in logging the message
"Hello World".
The draw package is now included in the sencha-charts package. That said, you'll need to include sencha charts in order to utilize draw classes (or sencha charts).
If you're using Sencha Cmd, this is as simple as adding "sencha-charts" to the requires
array in your app.json
file.
If you want to use charts, but do not want to use Sencha Cmd, you may simply add the following inclusions to your app's "index.html" page in Ext JS 7.
<script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/sencha-charts/build/sencha-charts.js"></script>
<link rel="stylesheet" type="text/css" href="{ExtJS-7-SDK}/build/packages/sencha-charts/build/classic/resources/sencha-charts-all.css">
In Ext JS 7 using the classic toolkit:
<script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/charts/classic/charts.js"></script>
<link rel="stylesheet" type="text/css" href="{ExtJS-7-SDK}/build/packages/charts/classic/classic/resources/charts-all.css">
In Ext JS 7 using the modern toolkit:
<script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/charts/modern/charts.js"></script>
<link rel="stylesheet" type="text/css" href="{ExtJS-7-SDK}/build/packages/charts/modern/modern-neptune/resources/charts-all.css">
In most cases zooming works as expected. However, it may take some extra work to properly render components when zoomed in. If you find an edge case let us know and we will queue it as an improvement.
callParent
is a method provided by the
Sencha Class System that is used to call methods in
your parent / ancestor class. This is commonly done when you derive from a framework
class and override a method it provides such as onRender
. When you invoke callParent
from a method that has parameters, you have two ways you can pass along those
parameters to the ancestor class method. The best practice method is to utilize only
the parameters that you specifically need. In that case, you can pass these arguments
in an array literal:
Ext.define('App.view.MyPanel', {
extend: 'Ext.panel.Panel',
onRender: function (parentNode, index) {
this.callParent([ parentNode, index ]);
}
});
Or, you could use the shorthand arguments keyword like so:
Ext.define('App.view.MyPanel', {
extend: 'Ext.panel.Panel',
onRender: function (parentNode, index) {
this.callParent(arguments);
}
});
The differences may seem minor, but when you use the Sencha Cmd optimizations for
callParent
, performance improvements can be profound. With the optimizer enabled, these
two methods are optimized as follows:
onRender: function (parentNode, index) {
Ext.panel.Panel.prototype.onRender.apply(this, arguments);
}
Or:
onRender: function (parentNode, index) {
Ext.panel.Panel.prototype.onRender.call(this, parentNode, index);
}
In the second case, the optimizer is able to use the call method on the JavaScript Function instead of apply. We also avoid using arguments. Both of which are well-known high performance no-no's. It turns out that we even avoid creating the array literal. Obviously, just enabling the optimization is helpful, but in code where performance is most critical, it is worth replacing arguments with the explicit array.