Upgrade to ExtJS 3.1.1 - Released 02/08/2010
[extjs.git] / docs / source / TableLayout.html
index b224f8d..45ffe71 100644 (file)
@@ -1,17 +1,12 @@
-<html>
-<head>
-  <title>The source code</title>
-    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
-    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-<div id="cls-Ext.layout.TableLayout"></div>/**\r
+<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
+</head>\r
+<body  onload="prettyPrint();">\r
+    <pre class="prettyprint lang-js"><div id="cls-Ext.layout.TableLayout"></div>/**\r
  * @class Ext.layout.TableLayout\r
  * @extends Ext.layout.ContainerLayout\r
  * <p>This layout allows you to easily render content into an HTML table.  The total number of columns can be\r
@@ -80,6 +75,10 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
     // private\r
     monitorResize:false,\r
 \r
+    type: 'table',\r
+\r
+    targetCls: 'x-table-layout-ct',\r
+\r
     <div id="cfg-Ext.layout.TableLayout-tableAttrs"></div>/**\r
      * @cfg {Object} tableAttrs\r
      * <p>An object containing properties which are added to the {@link Ext.DomHelper DomHelper} specification\r
@@ -89,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
@@ -107,7 +106,7 @@ 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
@@ -161,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
@@ -178,12 +177,17 @@ 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
         }else if(c && !this.isValidParent(c, target)){\r
             var container = this.getNextCell(c);\r
-            container.insertBefore(c.getDomPositionEl().dom, null);\r
+            container.insertBefore(c.getPositionEl().dom, null);\r
             c.container = Ext.get(container);\r
             this.configureItem(c, position);\r
         }\r
@@ -191,7 +195,7 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
 \r
     // private\r
     isValidParent : function(c, target){\r
-        return c.getDomPositionEl().up('table', 5).dom.parentNode === (target.dom || target);\r
+        return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target);\r
     }\r
 \r
     <div id="prop-Ext.layout.TableLayout-activeItem"></div>/**\r
@@ -200,6 +204,6 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
      */\r
 });\r
 \r
-Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;</pre>
-</body>
+Ext.Container.LAYOUTS['table'] = Ext.layout.TableLayout;</pre>    \r
+</body>\r
 </html>
\ No newline at end of file