-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-layout.Layout'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-layout-Layout'>/**
</span> * @class Ext.layout.Layout
* @extends Object
- * @private
* Base Layout class - extended by ComponentLayout and ContainerLayout
*/
-
Ext.define('Ext.layout.Layout', {
/* Begin Definitions */
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 || {});
}
Ext.apply(this, config);
},
-<span id='Ext-layout.Layout-method-layout'> /**
+<span id='Ext-layout-Layout-method-layout'> /**
</span> * @private
*/
layout : function() {
return true;
},
-<span id='Ext-layout.Layout-method-renderItems'> /**
+<span id='Ext-layout-Layout-method-renderItems'> /**
</span> * @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.
return false;
},
-<span id='Ext-layout.Layout-method-renderItem'> /**
+<span id='Ext-layout-Layout-method-renderItem'> /**
</span> * @private
* Renders the given Component into the target Element.
* @param {Ext.Component} item The Component to render
* @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;
}
},
-<span id='Ext-layout.Layout-method-moveItem'> /**
+<span id='Ext-layout-Layout-method-moveItem'> /**
</span> * @private
* Moved Component to the provided target instead.
*/
this.childrenChanged = true;
},
-<span id='Ext-layout.Layout-method-initLayout'> /**
+<span id='Ext-layout-Layout-method-initLayout'> /**
</span> * @private
* Adds the layout's targetCls if necessary and sets
* initialized flag when complete.
return [];
},
-<span id='Ext-layout.Layout-method-configureItem'> /**
+<span id='Ext-layout-Layout-property-configureItem'> /**
</span> * @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,
onDestroy : Ext.emptyFn,
doOwnerCtLayouts : Ext.emptyFn,
-<span id='Ext-layout.Layout-method-afterRemove'> /**
+<span id='Ext-layout-Layout-method-afterRemove'> /**
</span> * @private
* Removes itemCls
*/
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);
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;
},
/*
}
this.onDestroy();
}
-});</pre></pre></body></html>
\ No newline at end of file
+});</pre>
+</body>
+</html>