ColumnComponentLayout.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-grid-ColumnComponentLayout'>/**
  19. </span> * Component layout for grid column headers which have a title element at the top followed by content.
  20. * @private
  21. */
  22. Ext.define('Ext.grid.ColumnComponentLayout', {
  23. extend: 'Ext.layout.component.Auto',
  24. alias: 'layout.columncomponent',
  25. type: 'columncomponent',
  26. setWidthInDom: true,
  27. getContentHeight : function(ownerContext) {
  28. // If we are a group header return container layout's contentHeight, else default to AutoComponent's answer
  29. return this.owner.isGroupHeader ? ownerContext.getProp('contentHeight') : this.callParent(arguments);
  30. },
  31. calculateOwnerHeightFromContentHeight: function (ownerContext, contentHeight) {
  32. var result = this.callParent(arguments);
  33. if (this.owner.isGroupHeader) {
  34. result += this.owner.titleEl.dom.offsetHeight;
  35. }
  36. return result;
  37. },
  38. getContentWidth : function(ownerContext) {
  39. // If we are a group header return container layout's contentHeight, else default to AutoComponent's answer
  40. return this.owner.isGroupHeader ? ownerContext.getProp('contentWidth') : this.callParent(arguments);
  41. },
  42. calculateOwnerWidthFromContentWidth: function (ownerContext, contentWidth) {
  43. return contentWidth + ownerContext.getPaddingInfo().width;
  44. }
  45. });</pre>
  46. </body>
  47. </html>