API |
Change |
Resoluton |
Component render |
Only called on top-most components |
In previous releases, the render method was used to render all components in a top-down traversal. In 4.1, rendering is performed in memory as markup which is then written to the DOM. This means that the render method of child components is not called. Code in the render method should most likely move to either beforeRender (new to 4.1) or afterRender. For best performance, it is desirable to make style or add/removeCls adjustments in beforeRender so that these values will be generated in the initial markup and not made to the DOM element as it would be in afterRender. |
Component onRender |
Elements now exist in DOM at time of call |
In previous releases, the component's primary element ("el") was created when the parent class method was called. This is no longer possible due to bulk rendering. Any logic that was performed prior to calling the parent method can be moved to the new beforeRender method |
Component renderTpl |
Render Templates now call helper methods |
As part of bulk rendering, a renderTpl now calls helper methods on the template instance to inject content and container items. This can be best seen in the default renderTpl for Components:
PHP Code:
renderTpl: '{%this.renderContent(out,values)%}'
and Containers:
PHP Code:
renderTpl: '{%this.renderContainer(out,values)%}'
|
callParent in override |
calls overridden method |
This was changed as part of formalizing Ext.define/override. In 4.1, it is now possible to name and require overrides just as you would a normal class:
PHP Code:
Ext.define('My.patch.Grid', {
override: 'Ext.grid.Panel',
foo: function () {
this.callParent(); // calls Ext.grid.Panel.foo
}
});
The above code in 4.0 would have called the base class "foo" method instead. The callOverridden method was needed to do the above. To bypass the overriden method, you just need to do this:
PHP Code:
Ext.define('My.patch.Grid', {
override: 'Ext.grid.Panel',
foo: function () {
Ext.grid.Panel.superclass.foo.call(this);
}
});
It is possible for a class to even "require" its own overrides. This enables breaking up a large class into independent parts expressed as overrides (a better approach than "AbstractFoo" and "Foo"). |
FocusManager |
subscribe |
For details, see http://www.sencha.com/forum/showthre...l=1#post678781 |
Component |
doComponentLayout |
This method can still be called to perform a layout of the component, but its internals are quite different. As a component author, this method can no longer be overridden to perform a custom layout since it will not be called internally. Instead you can override afterComponentLayout which is given the new size and old size as parameters or you can respond to the resize event. If you are writing a derived component, the method override should be preferred - just don't forget to callParent.
One other note: the size of the component should not be changed by this method. The size has been determined already. If the size is changed again, this could lead to infinite recursion at worst (since afterComponentLayout will be called again) or just wrong layout. |
config |
setters are called to set default values |
In 4.0, the config mechanism in Ext.define would create getter and setter methods, but the default value would bypass the setter. In this build, we have a partial solution that uses initter methods but that will change to sync with Touch 2 and will simply call the setter. This can effect the timing of the first call to the setter method but is needed because setters were designed to enable transformation-on-set semantics. In Beta 1, this timing is much closer to 4.0. |
Ext.data.Model |
The model store property is now an array of stores. |
A single record can belong to more than 1 store, especially in the case of a tree. As such, we need to track a list of all the stores that the model belongs to |
Ext.layout.container.Border |
Split components are added to the container |
When configuring components with split: true, the layout will now insert extra splitter components as siblings of the current components. This allows for the layout to be much less complicated and also allows the ability to dynamically modify regions. |