X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/source/Accordion.html diff --git a/docs/source/Accordion.html b/docs/source/Accordion.html index 2b43997d..0c3ce448 100644 --- a/docs/source/Accordion.html +++ b/docs/source/Accordion.html @@ -1,4 +1,21 @@ -Sencha Documentation Project
/**
+
+
+
+  
+  The source code
+  
+  
+  
+  
+
+
+  
/**
  * @class Ext.layout.container.Accordion
  * @extends Ext.layout.container.VBox
  * <p>This is a layout that manages multiple Panels in an expandable accordion style such that only
@@ -40,22 +57,22 @@ Ext.define('Ext.layout.container.Accordion', {
     extend: 'Ext.layout.container.VBox',
     alias: ['layout.accordion'],
     alternateClassName: 'Ext.layout.AccordionLayout',
-    
+
     align: 'stretch',
 
-    /**
+    /**
      * @cfg {Boolean} fill
      * True to adjust the active item's height to fill the available space in the container, false to use the
      * item's current height, or auto height if not explicitly set (defaults to true).
      */
     fill : true,
-    /**
+    /**
      * @cfg {Boolean} autoWidth
      * <p><b>This config is ignored in ExtJS 4.x.</b></p>
      * Child Panels have their width actively managed to fit within the accordion's width.
      */
     autoWidth : true,
-    /**
+    /**
      * @cfg {Boolean} titleCollapse
      * <p><b>Not implemented in PR2.</b></p>
      * True to allow expand/collapse of each contained panel by clicking anywhere on the title bar, false to allow
@@ -63,26 +80,26 @@ Ext.define('Ext.layout.container.Accordion', {
      * {@link #hideCollapseTool} should be false also.
      */
     titleCollapse : true,
-    /**
+    /**
      * @cfg {Boolean} hideCollapseTool
      * True to hide the contained Panels' collapse/expand toggle buttons, false to display them (defaults to false).
      * When set to true, {@link #titleCollapse} is automatically set to <code>true</code>.
      */
     hideCollapseTool : false,
-    /**
+    /**
      * @cfg {Boolean} collapseFirst
      * True to make sure the collapse/expand toggle button always renders first (to the left of) any other tools
      * in the contained Panels' title bars, false to render it last (defaults to false).
      */
     collapseFirst : false,
-    /**
+    /**
      * @cfg {Boolean} animate
      * True to slide the contained panels open and closed during expand/collapse using animation, false to open and
      * close directly with no animation (defaults to <code>true</code>). Note: The layout performs animated collapsing
      * and expanding, <i>not</i> the child Panels.
      */
     animate : true,
-    /**
+    /**
      * @cfg {Boolean} activeOnTop
      * <p><b>Not implemented in PR4.</b></p>
      * <p>Only valid when {@link #multi" is <code>false</code>.</p>
@@ -90,7 +107,7 @@ Ext.define('Ext.layout.container.Accordion', {
      * false to keep the panels in the rendered order. <b>This is NOT compatible with "animate:true"</b> (defaults to false).
      */
     activeOnTop : false,
-    /**
+    /**
      * @cfg {Boolean} multi
      * Defaults to <code>false</code>. Set to <code>true</code> to enable multiple accordion items to be open at once.
      */
@@ -118,7 +135,7 @@ Ext.define('Ext.layout.container.Accordion', {
 
         me.callParent(arguments);
         if (me.fill) {
-            if (!me.owner.el.dom.style.height) {
+            if (!me.owner.el.dom.style.height || !me.getLayoutTargetSize().height) {
                 return false;
             }
         } else {
@@ -157,7 +174,6 @@ Ext.define('Ext.layout.container.Accordion', {
                 delete comp.hideHeader;
                 comp.collapsible = true;
                 comp.title = comp.title || '&#160;';
-                comp.setBorder(false);
 
                 // Set initial sizes
                 comp.width = targetSize.width;
@@ -170,12 +186,19 @@ Ext.define('Ext.layout.container.Accordion', {
                         comp.collapsed = true;
                     }
                     // Otherwise expand the first item with collapsed explicitly configured as false
-                    else if (comp.collapsed === false) {
+                    else if (comp.hasOwnProperty('collapsed') && comp.collapsed === false) {
                         comp.flex = 1;
                         me.expandedItem = i;
                     } else {
                         comp.collapsed = true;
                     }
+                    // If we are fitting, then intercept expand/collapse requests.
+                    me.owner.mon(comp, {
+                        show: me.onComponentShow,
+                        beforeexpand: me.onComponentExpand,
+                        beforecollapse: me.onComponentCollapse,
+                        scope: me
+                    });
                 } else {
                     delete comp.flex;
                     comp.animCollapse = me.initialAnimate;
@@ -194,10 +217,10 @@ Ext.define('Ext.layout.container.Accordion', {
                 comp.flex = 1;
             }
         }
-        
+
         // Render all Panels.
         me.callParent(arguments);
-                
+
         // Postprocess rendered Panels.
         ln = renderedPanels.length;
         for (i = 0; i < ln; i++) {
@@ -208,24 +231,13 @@ Ext.define('Ext.layout.container.Accordion', {
 
             comp.header.addCls(Ext.baseCSSPrefix + 'accordion-hd');
             comp.body.addCls(Ext.baseCSSPrefix + 'accordion-body');
-            
-            // If we are fitting, then intercept expand/collapse requests. 
-            if (me.fill) {
-                me.owner.mon(comp, {
-                    show: me.onComponentShow,
-                    beforeexpand: me.onComponentExpand,
-                    beforecollapse: me.onComponentCollapse,
-                    scope: me
-                });
-            }
         }
     },
 
     onLayout: function() {
         var me = this;
-        
-        me.updatePanelClasses();
-                
+
+
         if (me.fill) {
             me.callParent(arguments);
         } else {
@@ -243,24 +255,27 @@ Ext.define('Ext.layout.container.Accordion', {
                 }
             }
         }
-        
+        me.updatePanelClasses();
+
         return me;
     },
-    
+
     updatePanelClasses: function() {
         var children = this.getLayoutItems(),
             ln = children.length,
             siblingCollapsed = true,
             i, child;
-            
+
         for (i = 0; i < ln; i++) {
             child = children[i];
-            if (!siblingCollapsed) {
-                child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
+
+            if (siblingCollapsed) {
+                child.header.removeCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
             }
             else {
-                child.header.removeCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
+                child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-sibling-expanded');
             }
+
             if (i + 1 == ln && child.collapsed) {
                 child.header.addCls(Ext.baseCSSPrefix + 'accordion-hd-last-collapsed');
             }
@@ -289,7 +304,7 @@ Ext.define('Ext.layout.container.Accordion', {
                 me.setCollapsed(comp);
             }
         }
-        
+
         me.animate = me.initialAnimate;
         me.layout();
         me.animate = false;
@@ -311,7 +326,7 @@ Ext.define('Ext.layout.container.Accordion', {
             if (expanded.length === 1 && expanded[0] === comp) {
                 me.setExpanded(toExpand);
             }
-            
+
             me.animate = me.initialAnimate;
             me.layout();
             me.animate = false;
@@ -362,7 +377,7 @@ Ext.define('Ext.layout.container.Accordion', {
 
         // Show temporarily hidden docked items
         for (; i < len; i++) {
-            otherDocks[i].hidden = false;
+            otherDocks[i].show();
         }
 
         // If it was an initial native collapse which hides the body
@@ -382,4 +397,6 @@ Ext.define('Ext.layout.container.Accordion', {
         }
         comp.setAutoScroll(comp.initialConfig.autoScroll);
     }
-});
\ No newline at end of file +});
+ +