/** * @class pyriand3r.util.Ext5Container * This class provides a panel for an Ext5 application inside an Ext3.4 environment. * * @extends Ext.Panel */ pyriand3r.util.Ext5Container = Ext.extend(Ext.Panel, { /** * @constructor * Initiate panel with Ext5 container. */ initComponent: function () { var me = this; this.components = {}; Ext.applyIf(this, { containerConfig: {} }); Ext.applyIf(this.containerConfig, { layout: { type: 'fit', align: 'stretch' } }); Ext.apply(this.containerConfig, { renderTo: this.getContainerId() }); Ext.apply(this, { html: '
', items: {} }); pyriand3r.util.Ext5Container.superclass.initComponent.call(this); this.addListener('afterrender', function () { me.getContainer(); } ); this.addListener('resize', function (that, adjWidth, adjHeight) { me.getContainer().setSize(adjWidth, adjHeight); } ); this.addListener('destroy', function () { me.getContainer().destroy(); }); }, /** * @method * Return the ext5 container. Lazy * * @returns {Ext5.container.Container} */ getContainer: function () { if (!Ext.isObject(this.components.container)) { this.components.container = new Ext5.container.Container(this.containerConfig); } return this.components.container; }, /** * @methdo * Return the id of the container-div. * * @returns {string} */ getContainerId: function () { return this.id + '_container'; } });