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

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.

Cmd 7.0.0


top

Hierarchy

Cmd.codebase.json.Asset
Cmd.codebase.json.JS

Summary

These configs apply to JavaScript assets defined in the "js" array. The "js" array contains entries for each script that needs to be loaded as part of the application.

The starter app template (default template) includes two scripts on the "js" array:

 "js": [{
     "path": "${framework.dir}/build/ext-all-rtl-debug.js"
 }, {
     "path": "app.js",
     "bundle": true
 }]

The first entry is added to increase the speed of the development version, since it loads all Ext JS classes (even with right-to-left support) at once from a single js file instead of loading each from its own source file.

Any entries in the "js" array that point to files inside the framework directory will not be included in the final build output.

The second entry is the entry point of this application. The bundle config tells Sencha Cmd that this script should become the container for the concatenated classes. The app's "bundle" will be written to app.js in the build output folder.

The application bundle

All Ext JS applications make use of classes inside the Framework (for example Ext.Button or Ext.data.Store) as well as classes inside its namespace (for example MyApp.view.Main or MyApp.model.Item) or even classes that are part of a given package (for example MyCompany.common.User or ThirdParty.plugin.Widget). During the build process, all these classes are identified, listed and sorted according to how they need to be loaded (in order to transitively satisfy all dependencies). These files are concatenated into what Sencha Cmd calls the "application bundle".

You can think of the bundle as file that contains the following (the order is important):

 {all framework classes required by the application}
 {all theme-specific overrides}
 {all overrides specified by your application}
 {all classes inside your app's classpath (typically the "app" directory)}
 {all scripts with "includeInBundle": true}
 {the contents of the file with "bundle": true (typically app.js)}

Loading additional scripts

Loading additional scripts is as easy as adding them to the "js" array. Take the following example:

 "js": [{
     "path": "foo.js"
 }, {
     "path": "${framework.dir}/build/ext-all-rtl-debug.js"
 },{
     "path": "app.js",
     "bundle": true
 }, {
     "path": "bar.js"
 }]

In this example, foo.js will load before the application bundle, where bar.js will be loaded after it.

Sencha Cmd will copy these files to the build directory and will include them in the build manifest. When opening the application in the browser, three scripts will be requested in the following order:

 http://example.com/MyApp/foo.js
 http://example.com/MyApp/app.js
 http://example.com/MyApp/bar.js

Including scripts in the application bundle

You can instruct Sencha Cmd to include any script in the application bundle by specifying "includeInBundle": true on its entry:

 "js": [{
     "path": "${framework.dir}/build/ext-all-rtl-debug.js"
 },{
     "path": "foo.js",
     "includeInBundle": true
 },{
     "path": "app.js",
     "bundle": true
 }]

In this case foo.js will be included in the bundle, right before the content of app.js.

You can specify any number of files to be included in the bundle and their order will be preserved:

 "js": [{
     "path": "${framework.dir}/build/ext-all-rtl-debug.js"
 },{
     "path": "foo.js",
     "includeInBundle": true
 },{
     "path": "bar.js",
     "includeInBundle": true
 },{
     "path": "app.js",
     "bundle": true
 }]

The contents of ${build.dir}/app.js will now look like this:

 {all framework classes required by the application}
 {all theme-specific overrides}
 {all overrides specified by your application}
 {all classes inside your app's classpath (typically the "app" directory)}
 {the contents of foo.js}
 {the contents of bar.js}
 {the contents of the file with "bundle": true (typically app.js)}

Tweaking the inclusion order

While this may be a desired outcome for most cases, others may require the additional files to be included before the app bundle or even between the framework classes and the application classes. Let's see how we can achieve that.

Including scripts before the application bundle

As noted before, the application bundle is a Sencha Cmd concept that contains all the dependencies of the built application in the order they'll be needed. The top-most requirement are the core framework classes, which have no dependencies. This is why there's no out-of-the-box way to include scripts before other contents in the application bundle.

It is however possible to use the underlying ant task hooks to include a script before the bundle:

  1. Let's assume you want to include the contents of a file named foo.js, located in the root directory of the application:

    console.log("I'm foo.js");

  2. Add the following task to the application's build.xml file:

  3. Build the application

    sencha app build

  4. The contents of the built app.js will now look like this:

    {the contents of foo.js} {all framework classes required by the application} {all theme-specific overrides} {all overrides specified by your application} {all classes inside your app's classpath (typically the "app" directory)} {the contents of the file with "bundle": true (typically app.js)}

We took this approach instead of just concatenating to the file at the end to make sure the additional script is also optimized and minified (as part of the normal optimization and minification process).

Including scripts between the framework classes and the application classes

In some cases, you may have some scripts that require the framework to run but need to be loaded before any of the application classes. Let's check the bundle overview again (without additional scripts and this time with numbers so we can reference some items below):

 {(1) all framework classes required by the application}
 {(2) all theme-specific overrides}
 {(3) all overrides specified by your application}
 {(4) all classes inside your app's classpath (typically the "app" directory)}
 {(5) the contents of app.js}

We want some script(s) to be included before (4), because the application classes may depend on them.

To achieve this, we can make use of Compiler Directives. Let's take a look at the following example:

  1. Let's assume you want to include the contents of a file named foo.js, located in the root directory of the application:

    console.log("I'm foo.js");

  2. Let's add the following comment to app/Application.js:

    // @require ../foo.js

  3. Build the application

    sencha app build

  4. The contents of the built app.js will now look like this:

    {all framework classes required by the application} {all theme-specific overrides} {all overrides specified by your application} {the contents of foo.js} {all classes inside your app's classpath (typically the "app" directory)} {the contents of the file with "bundle": true (typically app.js)}

While the typical approach of loading files individually when loading the application may be suitable for most cases, Sencha Cmd provides some alternatives to include scripts into the concatenated file, either before all other code or once the framework classes are available (and before the application code is executed).

No members found using the current filters

configs

Required Configs

path : String
required req

Path to file. If the file is local this must be a relative path from the app.json file.

Optional Configs

bootstrap : Boolean

Set to true to indicate that is a development mode only dependency. These files will not be copied into the build directory or referenced in the generate app.json manifest for the micro-loader.

Defaults to:

false

bundle : Boolean

Set to true on one file to indicate that it should become the container for the concatenated classes.

includeInBundle : Boolean

Set to true to include this file in the concatenated classes.

remote : Boolean

Specify as true if this file is remote and should not be copied into the build folder. Defaults to false for a local file which will be copied.

Defaults to:

false

update : "delta" / "full"

If not specified, this file will only be loaded once, and cached inside localStorage until this value is changed.

You can specify:

  • "delta" to enable over-the-air delta update for this file.
  • "full" means full update will be made when this file changes.

properties

methods

Cmd 7.0.0