X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Layout.html diff --git a/docs/source/Layout.html b/docs/source/Layout.html index 6d4e2c86..84b9981e 100644 --- a/docs/source/Layout.html +++ b/docs/source/Layout.html @@ -18,10 +18,8 @@
/** * @class Ext.layout.Layout * @extends Object - * @private * Base Layout class - extended by ComponentLayout and ContainerLayout */ - Ext.define('Ext.layout.Layout', { /* Begin Definitions */ @@ -37,12 +35,12 @@ Ext.define('Ext.layout.Layout', { if (layout instanceof Ext.layout.Layout) { return Ext.createByAlias('layout.' + layout); } else { - if (Ext.isObject(layout)) { - type = layout.type; + if (!layout || typeof layout === 'string') { + type = layout || defaultType; + layout = {}; } else { - type = layout || defaultType; - layout = {}; + type = layout.type; } return Ext.createByAlias('layout.' + type, layout || {}); } @@ -123,10 +121,17 @@ Ext.define('Ext.layout.Layout', { * @param {Number} position The position within the target to render the item to */ renderItem : function(item, target, position) { + var me = this; if (!item.rendered) { + if (me.itemCls) { + item.addCls(me.itemCls); + } + if (me.owner.itemCls) { + item.addCls(me.owner.itemCls); + } item.render(target, position); - this.configureItem(item); - this.childrenChanged = true; + me.configureItem(item); + me.childrenChanged = true; } }, @@ -168,22 +173,12 @@ Ext.define('Ext.layout.Layout', { return []; }, - /** + /** * @private * Applies itemCls + * Empty template method */ - configureItem: function(item) { - var me = this, - el = item.el, - owner = me.owner; - - if (me.itemCls) { - el.addCls(me.itemCls); - } - if (owner.itemCls) { - el.addCls(owner.itemCls); - } - }, + configureItem: Ext.emptyFn, // Placeholder empty functions for subclasses to extend onLayout : Ext.emptyFn, @@ -201,6 +196,7 @@ Ext.define('Ext.layout.Layout', { el = item.el, owner = me.owner; + // Clear managed dimensions flag when removed from the layout. if (item.rendered) { if (me.itemCls) { el.removeCls(me.itemCls); @@ -209,6 +205,12 @@ Ext.define('Ext.layout.Layout', { el.removeCls(owner.itemCls); } } + + // These flags are set at the time a child item is added to a layout. + // The layout must decide if it is managing the item's width, or its height, or both. + // See AbstractComponent for docs on these properties. + delete item.layoutManagedWidth; + delete item.layoutManagedHeight; }, /*