-<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.FormLayout"></div>/**
+<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.FormLayout"></div>/**
* @class Ext.layout.FormLayout
* @extends Ext.layout.AnchorLayout
* <p>This layout manager is specifically designed for rendering and managing child Components of
* @type String
* @property labelStyle
*/
-
+
<div id="cfg-Ext.layout.FormLayout-trackLabels"></div>/**
* @cfg {Boolean} trackLabels
* True to show/hide the field label when the field is hidden. Defaults to <tt>false</tt>.
*/
trackLabels: false,
-
+
onRemove: function(c){
Ext.layout.FormLayout.superclass.onRemove.call(this, c);
- if(this.trackLabels && !this.isHide(c)){
+ if(this.trackLabels){
c.un('show', this.onFieldShow, this);
c.un('hide', this.onFieldHide, this);
}
var el = c.getPositionEl(),
ct = c.getItemCt && c.getItemCt();
if(c.rendered && ct){
- el.insertAfter(ct);
+ if (el && el.dom) {
+ el.insertAfter(ct);
+ }
Ext.destroy(ct);
Ext.destroyMembers(c, 'label', 'itemCt');
if(c.customItemCt){
}
}
},
-
+
// private
setContainer : function(ct){
Ext.layout.FormLayout.superclass.setContainer.call(this, ct);
}
}
},
-
+
+ // private
isHide: function(c){
return c.hideLabel || this.container.hideLabels;
},
-
+
onFieldShow: function(c){
c.getItemCt().removeClass('x-hide-' + c.hideMode);
},
-
+
onFieldHide: function(c){
- c.getItemCt().addClass('x-hide-' + c.hideMode);
+ c.getItemCt().addClass('x-hide-' + c.hideMode);
},
//private
}else{
c.itemCt = this.fieldTpl.append(target, args, true);
}
- if(!c.rendered){
- c.render('x-form-el-' + c.id);
- }else if(!this.isValidParent(c, target)){
- Ext.fly('x-form-el-' + c.id).appendChild(c.getPositionEl());
- }
if(!c.getItemCt){
// Non form fields don't have getItemCt, apply it here
// This will get cleaned up in onRemove
});
}
c.label = c.getItemCt().child('label.x-form-item-label');
- if(this.trackLabels && !this.isHide(c)){
+ if(!c.rendered){
+ c.render('x-form-el-' + c.id);
+ }else if(!this.isValidParent(c, target)){
+ Ext.fly('x-form-el-' + c.id).appendChild(c.getPositionEl());
+ }
+ if(this.trackLabels){
if(c.hidden){
this.onFieldHide(c);
}
* <li><b><tt>clearCls</tt></b> : String<div class="sub-desc">The CSS class to apply to the special clearing div
* rendered directly after each form field wrapper (defaults to <tt>'x-form-clear-left'</tt>)</div></li>
* </ul></div>
- * @param field The {@link Field Ext.form.Field} being rendered.
+ * @param (Ext.form.Field} field The {@link Ext.form.Field Field} being rendered.
* @return An object hash containing the properties required to render the Field.
*/
getTemplateArgs: function(field) {
}
return value;
},
-
+
adjustHeightAnchor : function(value, c){
if(c.label && !this.isHide(c) && (this.container.labelAlign == 'top')){
return value - c.label.getHeight();
// private
isValidParent : function(c, target){
- return target && this.container.getEl().contains(c.getDomPositionEl());
+ return target && this.container.getEl().contains(c.getPositionEl());
}
<div id="prop-Ext.layout.FormLayout-activeItem"></div>/**
*/
});
-Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout;</pre>
-</body>
+Ext.Container.LAYOUTS['form'] = Ext.layout.FormLayout;
+</pre> \r
+</body>\r
</html>
\ No newline at end of file