FieldContainer.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-layout-component-field-FieldContainer'>/**
  19. </span> * @private
  20. */
  21. Ext.define('Ext.layout.component.field.FieldContainer', {
  22. /* Begin Definitions */
  23. extend: 'Ext.layout.component.field.Field',
  24. alias: 'layout.fieldcontainer',
  25. /* End Definitions */
  26. type: 'fieldcontainer',
  27. waitForOuterHeightInDom: true,
  28. waitForOuterWidthInDom: true,
  29. beginLayout: function(ownerContext) {
  30. this.callParent(arguments);
  31. // Tell Component.measureAutoDimensions to measure the DOM when containerChildrenDone is true
  32. ownerContext.hasRawContent = true;
  33. ownerContext.target.bodyEl.setStyle('height', '');
  34. },
  35. measureContentHeight: function (ownerContext) {
  36. // since we are measuring the outer el, we have to wait for whatever is in our
  37. // container to be flushed to the DOM... especially for things like box layouts
  38. // that size the innerCt since that is all that will contribute to our size!
  39. return ownerContext.hasDomProp('containerLayoutDone') ? this.callParent(arguments) : NaN;
  40. },
  41. measureContentWidth: function (ownerContext) {
  42. // see measureContentHeight
  43. return ownerContext.hasDomProp('containerLayoutDone') ? this.callParent(arguments) : NaN;
  44. },
  45. publishInnerWidth: function (ownerContext, width) {
  46. var bodyContext = ownerContext.bodyCellContext;
  47. bodyContext.setWidth(bodyContext.el.getWidth(), false);
  48. },
  49. publishInnerHeight: function (ownerContext, height) {
  50. var bodyContext = ownerContext.bodyCellContext;
  51. bodyContext.setHeight(height - this.measureLabelErrorHeight(ownerContext));
  52. }
  53. });
  54. </pre>
  55. </body>
  56. </html>