Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / TableLayout.html
index f396e3b..45ffe71 100644 (file)
@@ -74,7 +74,9 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
 \r
     // private\r
     monitorResize:false,\r
-    \r
+\r
+    type: 'table',\r
+\r
     targetCls: 'x-table-layout-ct',\r
 \r
     <div id="cfg-Ext.layout.TableLayout-tableAttrs"></div>/**\r
@@ -86,16 +88,16 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
     layout: 'table',\r
     layoutConfig: {\r
         tableAttrs: {\r
-               style: {\r
-                       width: '100%'\r
-               }\r
+            style: {\r
+                width: '100%'\r
+            }\r
         },\r
         columns: 3\r
     }\r
 }</code></pre>\r
      */\r
     tableAttrs:null,\r
-    \r
+\r
     // private\r
     setContainer : function(ct){\r
         Ext.layout.TableLayout.superclass.setContainer.call(this, ct);\r
@@ -104,12 +106,14 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
         this.currentColumn = 0;\r
         this.cells = [];\r
     },\r
-\r
+    \r
     // private\r
     onLayout : function(ct, target){\r
         var cs = ct.items.items, len = cs.length, c, i;\r
 \r
         if(!this.table){\r
+            target.addClass('x-table-layout-ct');\r
+\r
             this.table = target.createChild(\r
                 Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true);\r
         }\r
@@ -156,7 +160,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
         this.getRow(curRow).appendChild(td);\r
         return td;\r
     },\r
-    \r
+\r
     // private\r
     getNextNonSpan: function(colIndex, rowIndex){\r
         var cols = this.columns;\r
@@ -173,6 +177,11 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
 \r
     // private\r
     renderItem : function(c, position, target){\r
+        // Ensure we have our inner table to get cells to render into.\r
+        if(!this.table){\r
+            this.table = target.createChild(\r
+                Ext.apply({tag:'table', cls:'x-table-layout', cellspacing: 0, cn: {tag: 'tbody'}}, this.tableAttrs), null, true);\r
+        }\r
         if(c && !c.rendered){\r
             c.render(this.getNextCell(c));\r
             this.configureItem(c, position);\r