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.

If you believe that your question warrants addition to this page, please let us know!

What browsers does Ext JS 5 Support?

Desktop

  • IE8+ (standards mode only)
  • Firefox (PC & Mac)
  • Safari 6+ +Chrome (PC & Mac)
  • Opera (PC & Mac)

Touch Screen

  • Safari
  • IE10 and above
  • Chrome on Androids

Note: Ext JS 5 does not currently support mobile phones

What Doctype should I use?

We recommend using the HTML5 doctype. To ensure the Internet Explorer does not activate Compatibility Mode, 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>

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 5. You can find your packages under ext/packages . Themes include:

  • ext-theme-base
  • ext-theme-classic
  • ext-theme-crisp
  • ext-theme-crisp-touch
  • ext-theme-gray
  • ext-theme-neptune
  • ext-theme-neptune-touch
  • ext-theme-neutral

You can walk through setting up your application without Sencha Cmd in our Welcome to Ext JS guide :

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.

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:

<head>
     <title>Hello World</title>
        <link rel="stylesheet" type="text/css" href="ext/build/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/build/packages/ext-theme-neptune/build/ext-theme-neptune.js"></script>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
</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.

Touch and Ext JS both have unique user interface controls built for the specific platforms each supports. Ext JS 5 supports tablets and computers but not smart-phones so it’s UI controls are not meant for such a small screen. Sencha Touch’s UI controls are built for a smaller screen but can also be used for tablets. So the answer would be that it depends on your target audience.

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

The entire data package will be shared between future versions of Ext JS and Touch. While this is intended to enable the sharing of code between Ext/Touch apps, the details of how all this will come together in the near future are not yet finalized.

How can I see what changed between Ext JS 4 and Ext JS 5?

To see new additions, please check out our What’s New in Ext JS 5 guide .

To see removals, additions, deprecations, etc, please check out our diff guide .

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 5?

Adding localization to your application is possible via locale-specific overrides, which can be set in your 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:

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

How do I use the Draw classes in 5?

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 block in your app.json file.

If you’re not using Sencha Cmd, you’ll need to include the “sencha-charts” package and include the sencha-charts.js and css files in your index.html file.

Note: The packages folder can be found at the root level of your local framework.

Does the framework support browser zoom?

We do not officially support browser zoom, but most components will work as expected in modern browsers.

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

callParent is a method provided by the Sencha Class System (common to Ext JS and Sencha Touch) that is used to call methods in your base 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 base 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:

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 5 new 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.

How do I use the CDN?

A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the web.

Our CDN provides a simple way to quickly get up and running with Ext JS. Using the CDN is ideal for prototypes and small “one-off” projects that don’t require optimization or speed.

Our CDN is not ideal or recommended for production applications. It’s also important to note that we make no guarantees regarding CDN service uptime or future availability.

Ext JS 5.0.0

Classic

Theme CSS

Core JS

Neptune

Theme CSS

Core JS

Theme JS Overrides

Crisp

Theme CSS

Core JS

Theme JS Overrides

Ext JS 4.2.1

Classic

Theme CSS

Core JS

Neptune

Theme CSS

Core JS

Theme JS Overrides

Last updated