Ext JS - FAQ

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.

What browsers does Ext JS Support?

Desktop

  • Microsoft Edge 12
  • IE8+ (standards mode only)
  • Firefox (PC & Mac)
  • Safari 11+(2017)
  • Safari 10(2016)
  • Chrome 43+(PC & Mac)
  • Opera (PC & Mac)

Touch Screen

  • Safari
  • IE10 and above
  • Chrome on Android

Note: Ext JS 5 does not currently support mobile phones

What Doctype should I use?

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:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. </head>

How can I build an application without Sencha Cmd?

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:

  • ext-theme-base (used by the framework and should not be configured directly)
  • ext-theme-neutral (used when creating custom themes and should not be configured directly)
  • ext-theme-classic
  • ext-theme-gray
  • ext-theme-neptune
  • ext-theme-neptune-touch (optimized for tablets)
  • ext-theme-crisp
  • ext-theme-crisp-touch (optimized for tablets)

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:

  • theme-base (used by the framework and should not be configured directly)
  • theme-neutral (used when creating custom themes and should not be configured directly)
  • theme-classic
  • theme-gray
  • theme-neptune
  • theme-neptune-touch (optimized for tablets)
  • theme-crisp
  • theme-crisp-touch (optimized for tablets)
  • theme-triton

Ext JS 7 modern themes are located within “{ExtJS-7-SDK}/modern/“ and include:

  • theme-base (used by the framework and should not be configured directly)
  • theme-blackberry
  • theme-cupertino
  • theme-cupertino-classic
  • theme-mountainview
  • theme-neptune
  • theme-windows

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.

What’s the difference between the different framework files?

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.

How can I change my application’s theme without using Sencha Cmd?

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:

  1. <head>
  2. <title>Hello World</title>
  3. <link rel="stylesheet" type="text/css" href="ext/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css">
  4. <script type="text/javascript" src="ext/build/ext-all-debug.js"></script>
  5. <script type="text/javascript" src="ext/packages/ext-theme-neptune/build/ext-theme-neptune.js"></script>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. </head>

Can I write a single application for both Desktop and iPad?

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.

If Ext JS 5+ works with tablets, why shouldn’t I use it for smart-phones as well?

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.

How can we share controllers, stores, models between ExtJs 5+ and Touch?

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.

How can I see what changed between versions?

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.

Does Ext JS 5+ render tables faster than ExtJS 4? Is the performance improved?

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.

Is it possible to use two different versions of Ext JS at same time?

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.

How should we utilize localization in Ext JS 7?

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.

How should I override a method without editing the source code?

The preferred way to create an override is as follows:

  1. Ext.define('MyApp.overrides.panel.Panel', {
  2. override: 'Ext.panel.Panel',
  3. close: function() {
  4. console.log('My Change to Close');
  5. this.callParent();
  6. },
  7. helloWorld: function(){
  8. console.log('Hello World');
  9. }
  10. });

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

How do I use the Draw classes in 7?

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.

Using Sencha Charts and Draw without Sencha Cmd

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.

  1. <script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/sencha-charts/build/sencha-charts.js"></script>
  2. <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:

  1. <script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/charts/classic/charts.js"></script>
  2. <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:

  1. <script type="text/javascript" src="{ExtJS-7-SDK}/build/packages/charts/modern/charts.js"></script>
  2. <link rel="stylesheet" type="text/css" href="{ExtJS-7-SDK}/build/packages/charts/modern/modern-neptune/resources/charts-all.css">

Does the framework support browser zoom?

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.

What is callParent and why/how should I use it?

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:

  1. Ext.define('App.view.MyPanel', {
  2. extend: 'Ext.panel.Panel',
  3. onRender: function (parentNode, index) {
  4. this.callParent([ parentNode, index ]);
  5. }
  6. });

Or, you could use the shorthand arguments keyword like so:

  1. Ext.define('App.view.MyPanel', {
  2. extend: 'Ext.panel.Panel',
  3. onRender: function (parentNode, index) {
  4. this.callParent(arguments);
  5. }
  6. });

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:

  1. onRender: function (parentNode, index) {
  2. Ext.panel.Panel.prototype.onRender.apply(this, arguments);
  3. }

Or:

  1. onRender: function (parentNode, index) {
  2. Ext.panel.Panel.prototype.onRender.call(this, parentNode, index);
  3. }

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.