Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / CardLayout.html
index 5ee808f..d1a776e 100644 (file)
@@ -1,5 +1,6 @@
 <html>\r
 <head>\r
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    \r
   <title>The source code</title>\r
     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
@@ -94,7 +95,7 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
     \r
     constructor: function(config){\r
         Ext.layout.CardLayout.superclass.constructor.call(this, config);\r
-        this.forceLayout = (this.deferredRender === false);\r
+      //  this.forceLayout = (this.deferredRender === false);\r
     },\r
 \r
     <div id="method-Ext.layout.CardLayout-setActiveItem"></div>/**\r
@@ -102,17 +103,23 @@ Ext.layout.CardLayout = Ext.extend(Ext.layout.FitLayout, {
      * @param {String/Number} item The string component id or numeric index of the item to activate\r
      */\r
     setActiveItem : function(item){\r
+        var ai = this.activeItem;\r
         item = this.container.getComponent(item);\r
-        if(this.activeItem != item){\r
-            if(this.activeItem){\r
-                this.activeItem.hide();\r
+        if(ai != item){\r
+            if(ai){\r
+                ai.hide();\r
+                ai.fireEvent('deactivate', ai);\r
             }\r
+            var layout = item.doLayout && (this.layoutOnCardChange || !item.rendered);\r
             this.activeItem = item;\r
-            item.show();\r
-            this.container.doLayout();\r
-            if(this.layoutOnCardChange && item.doLayout){\r
+            if(item){\r
+                item.show();\r
+            }\r
+            this.layout();\r
+            if(item && layout){\r
                 item.doLayout();\r
             }\r
+            item.fireEvent('activate', item);\r
         }\r
     },\r
 \r