Docs Help

Terms, Icons, and Labels

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.

Access Levels

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.

Member Types

Member Syntax

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

lookupComponent ( item ) : Ext.Component
protected

Called when a raw config object is added to this container either during initialization of the items config, or when new items are added), or {@link #insert inserted.

This method converts the passed object into an instanced child component.

This may be overridden in subclasses when special processing needs to be applied to child creation.

Parameters

item :  Object

The config object being added.

Returns
Ext.Component

The component to be added.

Let's look at each part of the member row:

Member Flags

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.

Class Icons

- 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

Member Icons

- 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

Class Member Quick-Nav Menu

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.

Getter and Setter Methods

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.

History Bar

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.

Search and Filters

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 and inheritance. 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.

API Doc Class Metadata

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:

Expanding and Collapsing Examples and Class Members

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.

Desktop -vs- Mobile View

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:

Viewing the Class Source

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.

Ext JS 5.0.1

Guides
API
top

What's New in Ext JS 5.0.1

Ext JS 5.0.1 is a maintenance release that addresses many bugs and limitations discovered by our community while testing Ext JS 5.0.0. We believe this update significantly strengthens the Ext JS 5 branch and we're excited to hear your feedback. If you feel there are pieces missing from this guide, please let us know in the Ext JS 5 forums.

Let's discuss a few of these improvements.

Accessibility

Ext JS 4.2.2 introduced the "ext-aria" package to provide improved support for accessibility, as described in the WAI-ARIA 1.0 standard. While this was an important step in creating accessible applications, we learned a lot from the feedback we received from our testing partners and early adopters. Ext JS 5.0.1 incorporates much of that feedback to provide a better solution moving forward.

Ext JS 5.0.1 re-introduces the concept of "ext-aria", in addition to many other exciting improvements. Further, we have migrated support for focus and keyboard navigation from "ext-aria" to the framework's core.

Focus

Ext JS 5.0.1 contains an improved strategy for the internal handling of focus. This internalization better aligns with accessibility standards. Core components, including buttons, tabs, form fields, and grids, now provide a clear, visual indication of focus. This is a key requirement for accessible applications. Users can modify several SASS variables and mixin parameters to gain more control over these new visual aspects.

Keyboard Navigation

Ext JS previously relied on Ext.FocusManager to assist in managing focus. While this class remains, it is no longer the recommended approach. It's important to note that Ext.FocusManager has been deprecated and its future existence should not be relied upon. In its place, we have added a "focusable" property to components. This property is used to manage the tabIndex DOM attribute. Any component, with this property set to true, will be able to receive focus by clicking or via the keyboard input.

When these focusable components are placed in certain containers (such as toolbars), the container provides arrow key navigation and manages which item will receive the focus on entry into the container.

For more details regarding accessibility, focus, and keyboard navigation improvements, see the Accessibility Guide.

ViewModels

We have addressed a number of bugs related to viewModels, but there are some noteworthy improvements related to binding as well.

Selection Binding

Developers may now use "selection" as a bindable property on certain components. These components include ComboBox, Grids, Trees, Breadcrumbs, etc. Using the selection binding keeps the component selections in sync.

For details, see the Kitchen Sink example.

Model & Field Validation

One key improvement with form fields is that two-way bindings now check that the value is valid before updating their bound properties. The form fields can now acquire the Model's validators and include them in their own validation.

As of Ext JS 5.0.1, invalid values will never be put back into your records.

Data

Ext.data has also been an area of a few key fixes and improvements in Ext JS 5.0.1.

TreeStore vs Node Events

The TreeStore class was refactored in Ext JS 5.0.0 to extend Ext.data.Store. With this change, TreeStore would relay events from the root node (Ext.data.NodeInterface). Unfortunately, certain node events collided with store events, which created problems for listeners. One such example was the "remove" event.

Ext JS 5.0.1 modifies the TreeStore strategy by prefixing all node events with "node" before firing them as TreeStore events. This means that the node's "remove" event is now fired from the TreeStore as "noderemove".

We always strive to avoid such changes in a maintenance release. However, this was a crucial change necessary to resolve the issue without breaking node listeners and/or store listeners.

Associations

Ext JS 5.0.0 introduced a lot of exciting new changes in terms of associations. However, one limitation that we discovered was that if you created a new record and then dropped that record, there was no cleanup logic to handle potential child records. This could create a situation where a session would generate create or update operations for these child records. These operations could not be processed by the server since the parent record was not saved.

Ext JS 5.0.1 offers reference fields that declare parent/child ownership between Models. These reference fields are then consulted when dropping records. When you indicate this type of association, dropped records will automatically handle deleting their child records.

For example:

Ext.define('App.model.Order', {
    extend: 'Ext.data.Model',
    // ...
});

Ext.define('App.model.OrderItem', {
    extend: 'Ext.data.Model',

    fields: [{
        name: 'orderId',

        // Indicates that the referenced Model (Order) owns these
        // records:
        reference: { parent: 'Order' }
    }]
});

In this way, when an Order it dropped (marked for deletion), its child OrderItems will likewise be dropped:

order.drop();

Further, setting parent references to null (for example, by removing it from the parent's association store) schedules that record for cleanup.

order.orderItems().removeAt(0); // removed orderItem is dropped

order.orderItems().getAt(0).setOrder(null); // also drops this item

The server is still ultimately responsible for a full cascade delete, but the above handling ensures that the client will never reference dropped records in save operations.

Responsive Configs

The new responsiveConfig provided by Ext.mixin.Responsive and Ext.plugin.Responsive provide flexibility for cleanly managing dynamic conditions.

The new responsiveFormulas allow you to add properties for responsiveConfig rules. For example, your main controller could do something like this to publish new properties:

Ext.define('MyApp.view.main.Main', {
    extend: 'Ext.container.Container',

    mixins: [
      'Ext.mixin.Responsive'
    ],

    responsiveFormulas: {
        small: 'width < 600',
        medium: 'width >= 600 && width < 800',
        large: 'width >= 800',

        tuesday: function (context) {
            return (new Date()).getDay() === 2;
        }
    }
});

These responsiveForumulas then produce these new values, which can be used in any of your responsiveConfig's. This can help streamline your application's responsiveConfigs, as well as give you a single place to maintain these kinds of choices.

Charts

The "sencha-charts" package also benefits from several improvements (such as some stock marker sprites like arrows, diamonds, etc). We've also modified our build process to include a packaged version of the sencha-charts package so that users aren't required to use Sencha Cmd. However, the most significant of these that we documented and exposed custom theme creation.

Chart Themes

Ext JS 5.0.0 shipped charts with several built-in themes that you could select for your charts. However, building custom themes was not a documented process. With this release, we have opened up this ability so that you can make your own color palettes and much more.

A theme for charts is a class derived from Ext.chart.theme.Base and given an alias that starts with:

"chart.theme." 

A basic theme could be as simple as this:

Ext.define('App.chart.theme.Awesome', {
    extend: 'Ext.chart.theme.Base',
    alias: 'chart.theme.awesome',

    singleton: true,

    config: {
      baseColor: '#4d7fe6'
    }
});

From here, you can add any number of other configs to style your series, axes and markers. To see all the options check out Ext.chart.theme.Base reference for the available configs.

To use the above you would simply set the "theme" config on your charts:

theme: 'awesome'

Sencha Cmd

Last but not least, Sencha Cmd 5.0.1 expands upon options available in app.json. This gives you more fine-grained control to configure your application without having to delve into the build scripts.

Output

To give you a peek at the most useful of these new controls, let's look at the "output" object. A common requirement for some environments is to maintain the "markup" file in a folder other than where the Sencha application resides. For example:

foo.php
foo/
    app.json
    app.js

The difference with this model is that the markup file ("foo.php" above, but it could be anything) is in a parent folder. In previous releases, this required setting several build properties. In Sencha Cmd 5.0.1 we can now do this in app.json:

{
    ...
    "output": {
        "page": {
            "path": "../foo.php",
            "enable": false
        }
    }
}

That single setting ensures that all paths will be calculated relative to the parent folder while also disabling the build step that rewrites the markup file. The "output" object can control many other aspects of your build's output such from enabling compiler optimizations to tuning the microloader.

To learn more about these new available options, please open app.json and review the robust commenting.

Packager

Cordova and PhoneGap are now much more flexible and easier to use with the new "packager" property. This new setting allows your build to specify its packager (either "cordova" or "phonegap") directly in app.json. Combined with the "builds" object, we can make an application that builds for web, iOS and Android. Further, we can specify local Cordova builds for Android and use the PhoneGap Cloud Build for iOS since iOS requires a Mac.

For example:

{
    ...
    "builds": {
        "web": {
            "default": true  // picked by "sencha app build" 
        },
        "ios": {
            "packager": "phonegap",
            "phonegap": {
                "config": {
            "platform": "ios",
                    "remote": true  // use PhoneGap Build
                }
            }
        },
        "android": {
            "packager": "phonegap"  // Any OS can build Android
        "phonegap": {
            "config": {
                "platform": "android" // use Local Phonegap
            }
        }
        }
    }
}

As before we can run a build like so:

sencha app build

The above will use the "web" build definition. But now we can also do these:

sencha app build ios
sencha app build android

Of course, you will need to have Cordova and PhoneGap installed and you will also need to configure your PhoneGap Build account. Other than formalities, you can see how this property cleans up the build process. Using this approach also frees you up to add "testing" to any of these builds and get uncompressed JavaScript code for debugging.

Wrap Up

We're very excited about the new functionality and many bug fixes in Ext JS 5.0.1. We believe that this is one of the strongest releases we've ever had and hope that you do to.

If you have questions, please open a thread on the Ext JS 5 Forums. If you're a support member, please open a ticket in the Support Portal.

Ext JS 5.0.1

Ext JS
Sencha Test
Cmd
Sencha Themer
GXT
IDE Plugins
Sencha Inspector
Architect
Sencha Fiddle
Touch
Offline Documentation

Sencha Test

2.0.1 2.0.0 1.0.3

Cmd

Cmd

Sencha Themer

1.1.0 1.0.2

GXT

4.x 3.x

IDE Plugins

IDE Plugins

Sencha Inspector

Sencha Inspector

Sencha Fiddle

Sencha Fiddle

Offline Documentation

Offline Documentation