Improving layout and rendering performance is a major focus of Ext JS 4.1. This session will discuss some of these details and how they might impact your application, custom components and custom layouts. Beyond these largely invisible features, Ext JS 4.1 has other exciting enhancements. We will also cover: improvements to Grid, Border layout, XTemplate, Data and the class system.
138. <tpl>
{% var i=0; %}
<tpl for=”x”>
{name}
{% if (++i==9) break; %}
</tpl>
</tpl>
Wednesday, November 2, 2011
139. <tpl> function tplFn (out, values..) {
{% var i=0; %} var i=0;
<tpl for=”x”> for (var n in values.x) {
{name} out.push(v2.name);
{% if (++i==9) break; %} if (++i == 9) break;
</tpl> }
</tpl> }
Wednesday, November 2, 2011
141. var tpl = new Ext.XTemplate(...);
// This:
var s = tpl.apply(data);
// is equivalent to:
var a = [];
tpl.applyOut(a, data);
s = a.join(‘’);
Wednesday, November 2, 2011
144. Overrides
Ext.define(‘My.patches.GridOverride’, {
Named and used
override: ‘Ext.grid.Panel’,
like a normal class
initComponent: function () {
this.callParent();
}
});
-------------------
Ext.define(‘My.app.App’, {
requires: [ ‘My.patches.*’ ],
...
});
Wednesday, November 2, 2011
145. Overrides
Ext.define(‘My.patches.GridOverride’, {
Named and used
override: ‘Ext.grid.Panel’,
like a normal class
initComponent: function () {
this.callParent();
}
});
Only added to the
-------------------
build if the target
Ext.define(‘My.app.App’, { class is required
requires: [ ‘My.patches.*’ ],
...
});
Wednesday, November 2, 2011
148. Methods in configs - 4.0
items: [ {
xtype: ‘foo’,
method: function (a) {
return Ext.foo.Bar.prototype.method.call(this, a*2);
a*2;
}
}]
Wednesday, November 2, 2011
149. Methods in configs - 4.0
items: [ {
xtype: ‘foo’,
method: function (a) {
return Ext.foo.Bar.prototype.method.call(this, a*2);
a*2;
}
}]
Messy if you need to call original method!
Wednesday, November 2, 2011