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.
Ext JS 6.5 represents a major update to the Modern toolkit and does contain a few breaking changes and a number of API's have been deprecated. This guide will walk you through all you need to know to upgrade your Ext JS 6.2 application to version 6.5.
While the Classic toolkit does not contain any breaking changes there are some changes in the core that can impact Classic applications.
The cls config of component was adjusted slightly and its relationship to the addCls
,
removeCls
, replaceCls
, and toggleCls
method family has changed. The cls
config no
longer interacts with these other API's. It simply removes the previous class(es) and
adds the new one(s). These other API's now directly delegate to the Element API and do
not affect the cls
config value.
Instead of instantiating the Ext.util.Draggable class, the draggable config now creates
an Ext.drag.Source
instance. This relationship is now a public whereas the details
of how draggable was previously implemented were private. Even so, it is understood
that many real-world applications would have had to dig beyond the public level and
so this is viewed as a breaking change.
One important outcome of this change is that the drag event is no longer fired, but
instead a dragmove
event is fired. The signatures of other drag events are also
different compared to those fired by Ext.util.Draggable
.
The signature for the painted event now conforms with the standard for component events by passing the component as the first argument.
listeners: {
painted: function (comp, element) {
}
}
The resize event now matches the signature in the Classic toolkit:
listeners: {
resize: function (sender, width, height, oldWidth, oldHeight) {
// was (element, info)
}
}
The onResize method is technically new but it can easily conflict with existing code that was wired to the resize event. Simply providing this method will now automatically set up the necessary resize monitoring. The signature also matches the Classic toolkit.
onResize: function (width, height, oldWidth, oldHeight) {
// resize event fires after this method is called
}
This config was renamed to the proper case of placeholder
. So getPlaceHolder
and
setPlaceHolder
and now also getPlaceholder
and setPlaceholder
, respectively.
The internals of how dataviews create elements have changed considerably and this could impact CSS selectors and application code. In previous releases the DataView (already an Ext.Container) created a special type of child container to contain the actual data items. In 6.5 this extra level of nesting was removed. There is now only a pair of additional elements wrapping the data items (the inner for sizing and the outer for scrolling).
There are some configs that will help provide reliable selectors: innerCls and itemCls. Because dataviews (and lists and grids) can be nested inside each other, the innerCls can be very helpful for writing safe immediate child selectors:
.my-inner-cls > .my-item-cls {
The API's to access to the contents of data view have been expanded to ensure that internal details like these do not affect applications going forward. For example, the mapToRecord method can be called to convert all types of things (like events or elements) into the associate record.
The useComponents
config is replaced by componentdataview
(Ext.dataview.Component). The config still works in some cases but code should
be changed to create the desired type of dataview.
Events like itemtap have been supplanted by childtap, and though the itemtap events are still supported they are deprecated. The new events allow for future-safe expansion and are more convenient in general.
listeners: {
itemtap: function (dataview, index, target, record, event) {
},
childtap: function (dataview, info) {
if (info.record) { // and many other properties
}
}
}
The same childtap event will gain properties in derived classes, such as grids. This
keeps the API clean and efficient instead of adding multiple families of events like
celltap
, headertap
, footertap
, rowtap
, etc..
These three class can be rendered by an itemTpl (or inside grid cells) and will adjust the response of the dataview to tap events.
The new selectable config replaces Ext.mixin.Selectable. The selectable config is used to configure an instance of Ext.dataview.selection.Model.
The disableSelection config has changed slightly such that it now only hides the selection state from the presentation.
Even though componentdataview is new to Ext JS 6.5, it
is equivalent to a dataview that had set useComponents:true
. The logic shared between
the classes is in the Ext.dataview.Abstract base class.
The defaultType now only applies to items added manually, not to rendered data items. To control the type of data items, use the xtype property of itemConfig.
The Ext.dataview.List class no longer extends Ext.dataview.DataView
. Instead it extends
Ext.dataview.Component
which in turn extends Ext.dataview.Abstract
so most of the
results of the previous inheritance scheme are preserved. This would not include
instanceof
, naturally. The proper way to check this would be the isDataView
property.
List inherits all of the same changes described above for DataView.
Any (manually added) item that is positioned (has its left, top, right or bottom config set) will be rendered to the body element of the list and not inside the scrolling area. This is really helpful for things like floating action buttons but is still a change in behavior.
Since Grid extends List, it also inherits the changes for List and DataView.
The Ext.grid.HeaderGroup class is no longer necessary and has been removed. All columns can simply define a columns config and get child columns since the column component now extends Ext.grid.HeaderContainer.
This plugin is automatically included and no longer needs to be required or added to plugins.
The Configurator's panelWrapper config has been removed. Instead set floated or docked on the panel config.
The updateRecord
method has been renamed to fillRecord
due to an existing name conflict
with the record configuration on component.
The form panel class has some base functionality extracted out into a superclass. Ext.field.Panel
is the new base, which contains functionality for managing multiple fields and getting/setting
their value. The Ext.form.Panel
class extends this by providing form submission logic. For those upgrading
existing applications, Ext.form.Panel
has the same behavior, however the lighter-weight superclass
may be used if form submission functionality isn't required.
The defaultValue config has been removed. Simply setting value will have essentially the same effect.
There was a bug fix to the bind expression parser that could be viewed as a breaking change that has to do with the subtraction operator. Due to a bug in the regular expressions the following was treated as a single identifier:
bind: '{foo-bar}'
This allowed "hyphenated names" to be given in some places. The expression parser now properly recognizes the above as a subtraction of bar from foo.
The behavior the set() and setData() methods has slightly changed as part of fixing some corner-case bugs. Instead of trying to describe these corner-cases, it is best to describe the expected behavior. To fully cover this area, consider a parent and child ViewModel:
parent: {
data: {
x: 1
}
},
child: {
data: {
y: 2
}
}
In this case the parent VM defined an "x" property and the child has added "y".
set
child.set('x', 10);
child.set('y', 10);
child.set('z', 10);
setData
child.setData({ x: 10 });
child.setData({ y: 10 });
child.setData({ z: 10 });
bind
child.bind('{x}').setValue(10);
child.bind('{y}').setValue(10);
child.bind('{z}').setValue(10);
To use an analogy, the data in a ViewModel is a lot like a JavaScript closure scope. The above arrangement would map to:
function parent () {
var x = 1;
function child () {
var y = 2;
}
}
The set method is like an assignment, so "child.set('x', 10)" is equivalent to assigning a value to x in the child function:
function parent () {
var x = 1;
function child () {
var y = 2;
x = 10; // sets x in outer scope (parent)
}
}
The setData method, however, is like a var statement. So "child.setData({ x: 10 })" is equivalent to:
function parent () {
var x = 1;
function child () {
var y = 2;
var x = 10; // hides x from the outer scope
}
}
The datachanged
event is now fired in conjunction with the update
event to bring
this in line with other store events. datachanged
can now act as a catch-all event.
To better align the API's of the charts and draw packages with other framework components, there are a couple API changes that will affect all users.
The highlight modifier's highlightStyle config has been renamed to style.
The fx config of Ext.draw.sprite.Sprite
has been renamed to animation.
The D3 library has been upgraded from version 3 to version 4 which carries with it breaking changes of its own. If you are using the components build on D3 then there are no changes to worry about, but if you are using D3 directly then upgrading will expose that code to D3's breaking changes.
See here for more information on these changes.