X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Layout.html diff --git a/docs/source/Layout.html b/docs/source/Layout.html index b51bb459..84b9981e 100644 --- a/docs/source/Layout.html +++ b/docs/source/Layout.html @@ -1,10 +1,25 @@ -
/**
+
+
+
+
+ The source code
+
+
+
+
+
+
+ /**
* @class Ext.layout.Layout
* @extends Object
- * @private
* Base Layout class - extended by ComponentLayout and ContainerLayout
*/
-
Ext.define('Ext.layout.Layout', {
/* Begin Definitions */
@@ -20,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 || {});
}
@@ -37,7 +52,7 @@ Ext.define('Ext.layout.Layout', {
Ext.apply(this, config);
},
- /**
+ /**
* @private
*/
layout : function() {
@@ -65,7 +80,7 @@ Ext.define('Ext.layout.Layout', {
return true;
},
- /**
+ /**
* @private
* Iterates over all passed items, ensuring they are rendered. If the items are already rendered,
* also determines if the items are in the proper place dom.
@@ -98,7 +113,7 @@ Ext.define('Ext.layout.Layout', {
return false;
},
- /**
+ /**
* @private
* Renders the given Component into the target Element.
* @param {Ext.Component} item The Component to render
@@ -106,14 +121,21 @@ 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;
}
},
- /**
+ /**
* @private
* Moved Component to the provided target instead.
*/
@@ -129,7 +151,7 @@ Ext.define('Ext.layout.Layout', {
this.childrenChanged = true;
},
- /**
+ /**
* @private
* Adds the layout's targetCls if necessary and sets
* initialized flag when complete.
@@ -151,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,
@@ -175,7 +187,7 @@ Ext.define('Ext.layout.Layout', {
onDestroy : Ext.emptyFn,
doOwnerCtLayouts : Ext.emptyFn,
- /**
+ /**
* @private
* Removes itemCls
*/
@@ -184,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);
@@ -192,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;
},
/*
@@ -208,4 +227,6 @@ Ext.define('Ext.layout.Layout', {
}
this.onDestroy();
}
-});
\ No newline at end of file
+});
+
+