Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / source / TableLayout.html
index da8a5da..f396e3b 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
@@ -73,6 +74,8 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
 \r
     // private\r
     monitorResize:false,\r
+    \r
+    targetCls: 'x-table-layout-ct',\r
 \r
     <div id="cfg-Ext.layout.TableLayout-tableAttrs"></div>/**\r
      * @cfg {Object} tableAttrs\r
@@ -107,8 +110,6 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
         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
@@ -174,16 +175,18 @@ Ext.layout.TableLayout = Ext.extend(Ext.layout.ContainerLayout, {
     renderItem : function(c, position, target){\r
         if(c && !c.rendered){\r
             c.render(this.getNextCell(c));\r
-            if(this.extraCls){\r
-                var t = c.getPositionEl ? c.getPositionEl() : c;\r
-                t.addClass(this.extraCls);\r
-            }\r
+            this.configureItem(c, position);\r
+        }else if(c && !this.isValidParent(c, target)){\r
+            var container = this.getNextCell(c);\r
+            container.insertBefore(c.getPositionEl().dom, null);\r
+            c.container = Ext.get(container);\r
+            this.configureItem(c, position);\r
         }\r
     },\r
 \r
     // private\r
     isValidParent : function(c, target){\r
-        return true;\r
+        return c.getPositionEl().up('table', 5).dom.parentNode === (target.dom || target);\r
     }\r
 \r
     <div id="prop-Ext.layout.TableLayout-activeItem"></div>/**\r