4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-layout-container-Container'>/**
19 </span>* @class Ext.layout.container.Container
20 * @extends Ext.layout.container.AbstractContainer
22 * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.container.Container#layout layout}</b></tt>
23 * configuration property. See <tt><b>{@link Ext.container.Container#layout}</b></tt> for additional details.</p>
25 Ext.define('Ext.layout.container.Container', {
27 /* Begin Definitions */
29 extend: 'Ext.layout.container.AbstractContainer',
30 alternateClassName: 'Ext.layout.ContainerLayout',
34 layoutItem: function(item, box) {
36 if (item.componentLayout.initialized !== true) {
37 this.setItemSize(item, box.width || item.width || undefined, box.height || item.height || undefined);
38 // item.doComponentLayout(box.width || item.width || undefined, box.height || item.height || undefined);
42 getLayoutTargetSize : function() {
43 var target = this.getTarget(),
47 ret = target.getViewSize();
49 // IE in will sometimes return a width of 0 on the 1st pass of getViewSize.
50 // Use getStyleSize to verify the 0 width, the adjustment pass will then work properly
52 if (Ext.isIE && ret.width == 0){
53 ret = target.getStyleSize();
56 ret.width -= target.getPadding('lr');
57 ret.height -= target.getPadding('tb');
62 beforeLayout: function() {
63 if (this.owner.beforeLayout(arguments) !== false) {
64 return this.callParent(arguments);
71 afterLayout: function() {
72 this.owner.afterLayout(arguments);
73 this.callParent(arguments);
76 <span id='Ext-layout-container-Container-method-getRenderedItems'> /**
78 * Returns all items that are rendered
79 * @return {Array} All matching items
81 getRenderedItems: function() {
83 target = me.getTarget(),
84 items = me.getLayoutItems(),
89 for (i = 0; i < ln; i++) {
91 if (item.rendered && me.isValidParent(item, target, i)) {
92 renderedItems.push(item);
99 <span id='Ext-layout-container-Container-method-getVisibleItems'> /**
101 * Returns all items that are both rendered and visible
102 * @return {Array} All matching items
104 getVisibleItems: function() {
105 var target = this.getTarget(),
106 items = this.getLayoutItems(),
111 for (i = 0; i < ln; i++) {
113 if (item.rendered && this.isValidParent(item, target, i) && item.hidden !== true) {
114 visibleItems.push(item);