]>
git.proxmox.com Git - extjs.git/blob - extjs/classic/classic/src/layout/component/field/FieldContainer.js
4 Ext
.define('Ext.layout.component.field.FieldContainer', {
6 /* Begin Definitions */
8 extend
: 'Ext.layout.component.Auto',
10 alias
: 'layout.fieldcontainer',
14 type
: 'fieldcontainer',
16 waitForOuterHeightInDom
: true,
17 waitForOuterWidthInDom
: true,
19 beginLayout: function(ownerContext
) {
20 var containerEl
= this.owner
.containerEl
;
22 this.callParent(arguments
);
24 // Tell Component.measureAutoDimensions to measure the DOM when containerChildrenSizeDone is true
25 ownerContext
.hasRawContent
= true;
26 containerEl
.setStyle('width', '');
27 containerEl
.setStyle('height', '');
28 ownerContext
.containerElContext
= ownerContext
.getEl('containerEl');
31 measureContentHeight: function (ownerContext
) {
32 // since we are measuring the outer el, we have to wait for whatever is in our
33 // container to be flushed to the DOM... especially for things like box layouts
34 // that size the innerCt since that is all that will contribute to our size!
35 return ownerContext
.hasDomProp('containerLayoutDone') ? this.callParent(arguments
) : NaN
;
38 measureContentWidth: function (ownerContext
) {
39 // see measureContentHeight
40 return ownerContext
.hasDomProp('containerLayoutDone') ? this.callParent(arguments
) : NaN
;
43 publishInnerHeight: function (ownerContext
, height
) {
44 var owner
= this.owner
;
46 if (owner
.labelAlign
=== 'top' && owner
.hasVisibleLabel()) {
47 height
-= owner
.labelEl
.getHeight();
50 if (owner
.msgTarget
=== 'under' && owner
.hasActiveError()) {
51 height
-= owner
.errorWrapEl
.getHeight();
54 height
-= owner
.bodyEl
.getPadding('tb');
56 ownerContext
.containerElContext
.setHeight(height
);
59 publishInnerWidth: function (ownerContext
, width
) {
60 var owner
= this.owner
;
62 if (owner
.labelAlign
!== 'top' && owner
.hasVisibleLabel()) {
63 width
-= (owner
.labelWidth
+ (owner
.labelPad
|| 0));
66 if (owner
.msgTarget
=== 'side' && owner
.hasActiveError()) {
67 width
-= owner
.errorWrapEl
.getWidth();
70 width
-= owner
.bodyEl
.getPadding('lr');
72 ownerContext
.containerElContext
.setWidth(width
);