X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6b044c28b5f26fb99c86c237ffad19741c0f7f3d:/src/widgets/layout/FormLayout.js?ds=inline diff --git a/src/widgets/layout/FormLayout.js b/src/widgets/layout/FormLayout.js index 80e34e97..15289581 100644 --- a/src/widgets/layout/FormLayout.js +++ b/src/widgets/layout/FormLayout.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.layout.FormLayout @@ -117,13 +117,12 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { /** * @cfg {Boolean} trackLabels - * True to show/hide the field label when the field is hidden. Defaults to false. + * True to show/hide the field label when the field is hidden. Defaults to true. */ - trackLabels: false, + trackLabels: true, type: 'form', - onRemove: function(c){ Ext.layout.FormLayout.superclass.onRemove.call(this, c); if(this.trackLabels){ @@ -132,14 +131,14 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { } // check for itemCt, since we may be removing a fieldset or something similar var el = c.getPositionEl(), - ct = c.getItemCt && c.getItemCt(); - if(c.rendered && ct){ + ct = c.getItemCt && c.getItemCt(); + if (c.rendered && ct) { if (el && el.dom) { el.insertAfter(ct); } Ext.destroy(ct); Ext.destroyMembers(c, 'label', 'itemCt'); - if(c.customItemCt){ + if (c.customItemCt) { Ext.destroyMembers(c, 'getItemCt', 'customItemCt'); } } @@ -159,7 +158,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { labelAdjust: 0 }); }else{ - this.labelSeparator = ct.labelSeparator || this.labelSeparator; + this.labelSeparator = Ext.isDefined(ct.labelSeparator) ? ct.labelSeparator : this.labelSeparator; ct.labelWidth = ct.labelWidth || 100; if(Ext.isNumber(ct.labelWidth)){ var pad = Ext.isNumber(ct.labelPad) ? ct.labelPad : 5; @@ -186,6 +185,11 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { onFieldShow: function(c){ c.getItemCt().removeClass('x-hide-' + c.hideMode); + + // Composite fields will need to layout after the container is made visible + if (c.isComposite) { + c.doLayout(); + } }, onFieldHide: function(c){ @@ -199,7 +203,7 @@ Ext.layout.FormLayout = Ext.extend(Ext.layout.AnchorLayout, { if (items[i]){ ls += items[i]; if (ls.substr(-1, 1) != ';'){ - ls += ';' + ls += ';'; } } } @@ -240,7 +244,10 @@ new Ext.Template( *
Also see {@link #getTemplateArgs}
*/ - // private + /** + * @private + * + */ renderItem : function(c, position, target){ if(c && (c.isFormField || c.fieldLabel) && c.inputType != 'hidden'){ var args = this.getTemplateArgs(c); @@ -298,7 +305,7 @@ new Ext.Template( * A CSS style specification string to add to the field label for this field (defaults to '' or the * {@link #labelStyle layout's value for labelStyle}). *