You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1813 lines
84 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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-Panel-method-constructor'><span id='Ext-Panel'>/**
  19. </span></span> * @class Ext.Panel
  20. * @extends Ext.Container
  21. * &lt;p&gt;Panel is a container that has specific functionality and structural components that make
  22. * it the perfect building block for application-oriented user interfaces.&lt;/p&gt;
  23. * &lt;p&gt;Panels are, by virtue of their inheritance from {@link Ext.Container}, capable
  24. * of being configured with a {@link Ext.Container#layout layout}, and containing child Components.&lt;/p&gt;
  25. * &lt;p&gt;When either specifying child {@link Ext.Component#items items} of a Panel, or dynamically {@link Ext.Container#add adding} Components
  26. * to a Panel, remember to consider how you wish the Panel to arrange those child elements, and whether
  27. * those child elements need to be sized using one of Ext's built-in &lt;code&gt;&lt;b&gt;{@link Ext.Container#layout layout}&lt;/b&gt;&lt;/code&gt; schemes. By
  28. * default, Panels use the {@link Ext.layout.ContainerLayout ContainerLayout} scheme. This simply renders
  29. * child components, appending them one after the other inside the Container, and &lt;b&gt;does not apply any sizing&lt;/b&gt;
  30. * at all.&lt;/p&gt;
  31. * &lt;p&gt;A Panel may also contain {@link #bbar bottom} and {@link #tbar top} toolbars, along with separate
  32. * {@link #header}, {@link #footer} and {@link #body} sections (see {@link #frame} for additional
  33. * information).&lt;/p&gt;
  34. * &lt;p&gt;Panel also provides built-in {@link #collapsible expandable and collapsible behavior}, along with
  35. * a variety of {@link #tools prebuilt tool buttons} that can be wired up to provide other customized
  36. * behavior. Panels can be easily dropped into any {@link Ext.Container Container} or layout, and the
  37. * layout and rendering pipeline is {@link Ext.Container#add completely managed by the framework}.&lt;/p&gt;
  38. * @constructor
  39. * @param {Object} config The config object
  40. * @xtype panel
  41. */
  42. Ext.Panel = Ext.extend(Ext.Container, {
  43. <span id='Ext-Panel-property-header'> /**
  44. </span> * The Panel's header {@link Ext.Element Element}. Read-only.
  45. * &lt;p&gt;This Element is used to house the {@link #title} and {@link #tools}&lt;/p&gt;
  46. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the Note for &lt;code&gt;{@link Ext.Component#el el}&lt;/code&gt; also.&lt;/p&gt;
  47. * @type Ext.Element
  48. * @property header
  49. */
  50. <span id='Ext-Panel-property-body'> /**
  51. </span> * The Panel's body {@link Ext.Element Element} which may be used to contain HTML content.
  52. * The content may be specified in the {@link #html} config, or it may be loaded using the
  53. * {@link autoLoad} config, or through the Panel's {@link #getUpdater Updater}. Read-only.
  54. * &lt;p&gt;If this is used to load visible HTML elements in either way, then
  55. * the Panel may not be used as a Layout for hosting nested Panels.&lt;/p&gt;
  56. * &lt;p&gt;If this Panel is intended to be used as the host of a Layout (See {@link #layout}
  57. * then the body Element must not be loaded or changed - it is under the control
  58. * of the Panel's Layout.
  59. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the Note for &lt;code&gt;{@link Ext.Component#el el}&lt;/code&gt; also.&lt;/p&gt;
  60. * @type Ext.Element
  61. * @property body
  62. */
  63. <span id='Ext-Panel-property-bwrap'> /**
  64. </span> * The Panel's bwrap {@link Ext.Element Element} used to contain other Panel elements
  65. * (tbar, body, bbar, footer). See {@link #bodyCfg}. Read-only.
  66. * @type Ext.Element
  67. * @property bwrap
  68. */
  69. <span id='Ext-Panel-property-collapsed'> /**
  70. </span> * True if this panel is collapsed. Read-only.
  71. * @type Boolean
  72. * @property collapsed
  73. */
  74. <span id='Ext-Panel-cfg-bodyCfg'> /**
  75. </span> * @cfg {Object} bodyCfg
  76. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object may be specified for any
  77. * Panel Element.&lt;/p&gt;
  78. * &lt;p&gt;By default, the Default element in the table below will be used for the html markup to
  79. * create a child element with the commensurate Default class name (&lt;code&gt;baseCls&lt;/code&gt; will be
  80. * replaced by &lt;code&gt;{@link #baseCls}&lt;/code&gt;):&lt;/p&gt;
  81. * &lt;pre&gt;
  82. * Panel Default Default Custom Additional Additional
  83. * Element element class element class style
  84. * ======== ========================== ========= ============== ===========
  85. * {@link #header} div {@link #baseCls}+'-header' {@link #headerCfg} headerCssClass headerStyle
  86. * {@link #bwrap} div {@link #baseCls}+'-bwrap' {@link #bwrapCfg} bwrapCssClass bwrapStyle
  87. * + tbar div {@link #baseCls}+'-tbar' {@link #tbarCfg} tbarCssClass tbarStyle
  88. * + {@link #body} div {@link #baseCls}+'-body' {@link #bodyCfg} {@link #bodyCssClass} {@link #bodyStyle}
  89. * + bbar div {@link #baseCls}+'-bbar' {@link #bbarCfg} bbarCssClass bbarStyle
  90. * + {@link #footer} div {@link #baseCls}+'-footer' {@link #footerCfg} footerCssClass footerStyle
  91. * &lt;/pre&gt;
  92. * &lt;p&gt;Configuring a Custom element may be used, for example, to force the {@link #body} Element
  93. * to use a different form of markup than is created by default. An example of this might be
  94. * to {@link Ext.Element#createChild create a child} Panel containing a custom content, such as
  95. * a header, or forcing centering of all Panel content by having the body be a &amp;lt;center&amp;gt;
  96. * element:&lt;/p&gt;
  97. * &lt;pre&gt;&lt;code&gt;
  98. new Ext.Panel({
  99. title: 'Message Title',
  100. renderTo: Ext.getBody(),
  101. width: 200, height: 130,
  102. &lt;b&gt;bodyCfg&lt;/b&gt;: {
  103. tag: 'center',
  104. cls: 'x-panel-body', // Default class not applied if Custom element specified
  105. html: 'Message'
  106. },
  107. footerCfg: {
  108. tag: 'h2',
  109. cls: 'x-panel-footer', // same as the Default class
  110. html: 'footer html'
  111. },
  112. footerCssClass: 'custom-footer', // additional css class, see {@link Ext.element#addClass addClass}
  113. footerStyle: 'background-color:red' // see {@link #bodyStyle}
  114. });
  115. * &lt;/code&gt;&lt;/pre&gt;
  116. * &lt;p&gt;The example above also explicitly creates a &lt;code&gt;{@link #footer}&lt;/code&gt; with custom markup and
  117. * styling applied.&lt;/p&gt;
  118. */
  119. <span id='Ext-Panel-cfg-headerCfg'> /**
  120. </span> * @cfg {Object} headerCfg
  121. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
  122. * of this Panel's {@link #header} Element. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; also.&lt;/p&gt;
  123. */
  124. <span id='Ext-Panel-cfg-bwrapCfg'> /**
  125. </span> * @cfg {Object} bwrapCfg
  126. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
  127. * of this Panel's {@link #bwrap} Element. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; also.&lt;/p&gt;
  128. */
  129. <span id='Ext-Panel-cfg-tbarCfg'> /**
  130. </span> * @cfg {Object} tbarCfg
  131. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
  132. * of this Panel's {@link #tbar} Element. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; also.&lt;/p&gt;
  133. */
  134. <span id='Ext-Panel-cfg-bbarCfg'> /**
  135. </span> * @cfg {Object} bbarCfg
  136. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
  137. * of this Panel's {@link #bbar} Element. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; also.&lt;/p&gt;
  138. */
  139. <span id='Ext-Panel-cfg-footerCfg'> /**
  140. </span> * @cfg {Object} footerCfg
  141. * &lt;p&gt;A {@link Ext.DomHelper DomHelper} element specification object specifying the element structure
  142. * of this Panel's {@link #footer} Element. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; also.&lt;/p&gt;
  143. */
  144. <span id='Ext-Panel-cfg-closable'> /**
  145. </span> * @cfg {Boolean} closable
  146. * Panels themselves do not directly support being closed, but some Panel subclasses do (like
  147. * {@link Ext.Window}) or a Panel Class within an {@link Ext.TabPanel}. Specify &lt;code&gt;true&lt;/code&gt;
  148. * to enable closing in such situations. Defaults to &lt;code&gt;false&lt;/code&gt;.
  149. */
  150. <span id='Ext-Panel-property-footer'> /**
  151. </span> * The Panel's footer {@link Ext.Element Element}. Read-only.
  152. * &lt;p&gt;This Element is used to house the Panel's &lt;code&gt;{@link #buttons}&lt;/code&gt; or &lt;code&gt;{@link #fbar}&lt;/code&gt;.&lt;/p&gt;
  153. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the Note for &lt;code&gt;{@link Ext.Component#el el}&lt;/code&gt; also.&lt;/p&gt;
  154. * @type Ext.Element
  155. * @property footer
  156. */
  157. <span id='Ext-Panel-cfg-applyTo'> /**
  158. </span> * @cfg {Mixed} applyTo
  159. * &lt;p&gt;The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in
  160. * the document that specifies some panel-specific structural markup. When &lt;code&gt;applyTo&lt;/code&gt; is used,
  161. * constituent parts of the panel can be specified by CSS class name within the main element, and the panel
  162. * will automatically create those components from that markup. Any required components not specified in the
  163. * markup will be autogenerated if necessary.&lt;/p&gt;
  164. * &lt;p&gt;The following class names are supported (baseCls will be replaced by {@link #baseCls}):&lt;/p&gt;
  165. * &lt;ul&gt;&lt;li&gt;baseCls + '-header'&lt;/li&gt;
  166. * &lt;li&gt;baseCls + '-header-text'&lt;/li&gt;
  167. * &lt;li&gt;baseCls + '-bwrap'&lt;/li&gt;
  168. * &lt;li&gt;baseCls + '-tbar'&lt;/li&gt;
  169. * &lt;li&gt;baseCls + '-body'&lt;/li&gt;
  170. * &lt;li&gt;baseCls + '-bbar'&lt;/li&gt;
  171. * &lt;li&gt;baseCls + '-footer'&lt;/li&gt;&lt;/ul&gt;
  172. * &lt;p&gt;Using this config, a call to render() is not required. If applyTo is specified, any value passed for
  173. * {@link #renderTo} will be ignored and the target element's parent node will automatically be used as the
  174. * panel's container.&lt;/p&gt;
  175. */
  176. <span id='Ext-Panel-cfg-tbar'> /**
  177. </span> * @cfg {Object/Array} tbar
  178. * &lt;p&gt;The top toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
  179. * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render.
  180. * To access the top toolbar after render, use {@link #getTopToolbar}.&lt;/p&gt;
  181. * &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Although a Toolbar may contain Field components, these will &lt;b&gt;not&lt;/b&gt; be updated by a load
  182. * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container-&gt;Component hierarchy, and
  183. * so are not scanned to collect form items. However, the values &lt;b&gt;will&lt;/b&gt; be submitted because form
  184. * submission parameters are collected from the DOM tree.&lt;/p&gt;
  185. */
  186. <span id='Ext-Panel-cfg-bbar'> /**
  187. </span> * @cfg {Object/Array} bbar
  188. * &lt;p&gt;The bottom toolbar of the panel. This can be a {@link Ext.Toolbar} object, a toolbar config, or an array of
  189. * buttons/button configs to be added to the toolbar. Note that this is not available as a property after render.
  190. * To access the bottom toolbar after render, use {@link #getBottomToolbar}.&lt;/p&gt;
  191. * &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Although a Toolbar may contain Field components, these will &lt;b&gt;not&lt;/b&gt; be updated by a load
  192. * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container-&gt;Component hierarchy, and
  193. * so are not scanned to collect form items. However, the values &lt;b&gt;will&lt;/b&gt; be submitted because form
  194. * submission parameters are collected from the DOM tree.&lt;/p&gt;
  195. */
  196. <span id='Ext-Panel-cfg-fbar'> /** @cfg {Object/Array} fbar
  197. </span> * &lt;p&gt;A {@link Ext.Toolbar Toolbar} object, a Toolbar config, or an array of
  198. * {@link Ext.Button Button}s/{@link Ext.Button Button} configs, describing a {@link Ext.Toolbar Toolbar} to be rendered into this Panel's footer element.&lt;/p&gt;
  199. * &lt;p&gt;After render, the &lt;code&gt;fbar&lt;/code&gt; property will be an {@link Ext.Toolbar Toolbar} instance.&lt;/p&gt;
  200. * &lt;p&gt;If &lt;code&gt;{@link #buttons}&lt;/code&gt; are specified, they will supersede the &lt;code&gt;fbar&lt;/code&gt; configuration property.&lt;/p&gt;
  201. * The Panel's &lt;code&gt;{@link #buttonAlign}&lt;/code&gt; configuration affects the layout of these items, for example:
  202. * &lt;pre&gt;&lt;code&gt;
  203. var w = new Ext.Window({
  204. height: 250,
  205. width: 500,
  206. bbar: new Ext.Toolbar({
  207. items: [{
  208. text: 'bbar Left'
  209. },'-&gt;',{
  210. text: 'bbar Right'
  211. }]
  212. }),
  213. {@link #buttonAlign}: 'left', // anything but 'center' or 'right' and you can use '-', and '-&gt;'
  214. // to control the alignment of fbar items
  215. fbar: [{
  216. text: 'fbar Left'
  217. },'-&gt;',{
  218. text: 'fbar Right'
  219. }]
  220. }).show();
  221. * &lt;/code&gt;&lt;/pre&gt;
  222. * &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Although a Toolbar may contain Field components, these will &lt;b&gt;not&lt;/b&gt; be updated by a load
  223. * of an ancestor FormPanel. A Panel's toolbars are not part of the standard Container-&gt;Component hierarchy, and
  224. * so are not scanned to collect form items. However, the values &lt;b&gt;will&lt;/b&gt; be submitted because form
  225. * submission parameters are collected from the DOM tree.&lt;/p&gt;
  226. */
  227. <span id='Ext-Panel-cfg-header'> /**
  228. </span> * @cfg {Boolean} header
  229. * &lt;code&gt;true&lt;/code&gt; to create the Panel's header element explicitly, &lt;code&gt;false&lt;/code&gt; to skip creating
  230. * it. If a &lt;code&gt;{@link #title}&lt;/code&gt; is set the header will be created automatically, otherwise it will not.
  231. * If a &lt;code&gt;{@link #title}&lt;/code&gt; is set but &lt;code&gt;header&lt;/code&gt; is explicitly set to &lt;code&gt;false&lt;/code&gt;, the header
  232. * will not be rendered.
  233. */
  234. <span id='Ext-Panel-cfg-footer'> /**
  235. </span> * @cfg {Boolean} footer
  236. * &lt;code&gt;true&lt;/code&gt; to create the footer element explicitly, false to skip creating it. The footer
  237. * will be created automatically if &lt;code&gt;{@link #buttons}&lt;/code&gt; or a &lt;code&gt;{@link #fbar}&lt;/code&gt; have
  238. * been configured. See &lt;code&gt;{@link #bodyCfg}&lt;/code&gt; for an example.
  239. */
  240. <span id='Ext-Panel-cfg-title'> /**
  241. </span> * @cfg {String} title
  242. * The title text to be used as innerHTML (html tags are accepted) to display in the panel
  243. * &lt;code&gt;{@link #header}&lt;/code&gt; (defaults to ''). When a &lt;code&gt;title&lt;/code&gt; is specified the
  244. * &lt;code&gt;{@link #header}&lt;/code&gt; element will automatically be created and displayed unless
  245. * {@link #header} is explicitly set to &lt;code&gt;false&lt;/code&gt;. If you do not want to specify a
  246. * &lt;code&gt;title&lt;/code&gt; at config time, but you may want one later, you must either specify a non-empty
  247. * &lt;code&gt;title&lt;/code&gt; (a blank space ' ' will do) or &lt;code&gt;header:true&lt;/code&gt; so that the container
  248. * element will get created.
  249. */
  250. <span id='Ext-Panel-cfg-buttons'> /**
  251. </span> * @cfg {Array} buttons
  252. * &lt;code&gt;buttons&lt;/code&gt; will be used as &lt;code&gt;{@link Ext.Container#items items}&lt;/code&gt; for the toolbar in
  253. * the footer (&lt;code&gt;{@link #fbar}&lt;/code&gt;). Typically the value of this configuration property will be
  254. * an array of {@link Ext.Button}s or {@link Ext.Button} configuration objects.
  255. * If an item is configured with &lt;code&gt;minWidth&lt;/code&gt; or the Panel is configured with &lt;code&gt;minButtonWidth&lt;/code&gt;,
  256. * that width will be applied to the item.
  257. */
  258. <span id='Ext-Panel-cfg-autoLoad'> /**
  259. </span> * @cfg {Object/String/Function} autoLoad
  260. * A valid url spec according to the Updater {@link Ext.Updater#update} method.
  261. * If autoLoad is not null, the panel will attempt to load its contents
  262. * immediately upon render.&lt;p&gt;
  263. * The URL will become the default URL for this panel's {@link #body} element,
  264. * so it may be {@link Ext.Element#refresh refresh}ed at any time.&lt;/p&gt;
  265. */
  266. <span id='Ext-Panel-cfg-frame'> /**
  267. </span> * @cfg {Boolean} frame
  268. * &lt;code&gt;false&lt;/code&gt; by default to render with plain 1px square borders. &lt;code&gt;true&lt;/code&gt; to render with
  269. * 9 elements, complete with custom rounded corners (also see {@link Ext.Element#boxWrap}).
  270. * &lt;p&gt;The template generated for each condition is depicted below:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  271. *
  272. // frame = false
  273. &amp;lt;div id=&quot;developer-specified-id-goes-here&quot; class=&quot;x-panel&quot;&gt;
  274. &amp;lt;div class=&quot;x-panel-header&quot;&gt;&amp;lt;span class=&quot;x-panel-header-text&quot;&gt;Title: (frame:false)&amp;lt;/span&gt;&amp;lt;/div&gt;
  275. &amp;lt;div class=&quot;x-panel-bwrap&quot;&gt;
  276. &amp;lt;div class=&quot;x-panel-body&quot;&gt;&amp;lt;p&gt;html value goes here&amp;lt;/p&gt;&amp;lt;/div&gt;
  277. &amp;lt;/div&gt;
  278. &amp;lt;/div&gt;
  279. // frame = true (create 9 elements)
  280. &amp;lt;div id=&quot;developer-specified-id-goes-here&quot; class=&quot;x-panel&quot;&gt;
  281. &amp;lt;div class=&quot;x-panel-tl&quot;&gt;&amp;lt;div class=&quot;x-panel-tr&quot;&gt;&amp;lt;div class=&quot;x-panel-tc&quot;&gt;
  282. &amp;lt;div class=&quot;x-panel-header&quot;&gt;&amp;lt;span class=&quot;x-panel-header-text&quot;&gt;Title: (frame:true)&amp;lt;/span&gt;&amp;lt;/div&gt;
  283. &amp;lt;/div&gt;&amp;lt;/div&gt;&amp;lt;/div&gt;
  284. &amp;lt;div class=&quot;x-panel-bwrap&quot;&gt;
  285. &amp;lt;div class=&quot;x-panel-ml&quot;&gt;&amp;lt;div class=&quot;x-panel-mr&quot;&gt;&amp;lt;div class=&quot;x-panel-mc&quot;&gt;
  286. &amp;lt;div class=&quot;x-panel-body&quot;&gt;&amp;lt;p&gt;html value goes here&amp;lt;/p&gt;&amp;lt;/div&gt;
  287. &amp;lt;/div&gt;&amp;lt;/div&gt;&amp;lt;/div&gt;
  288. &amp;lt;div class=&quot;x-panel-bl&quot;&gt;&amp;lt;div class=&quot;x-panel-br&quot;&gt;&amp;lt;div class=&quot;x-panel-bc&quot;/&gt;
  289. &amp;lt;/div&gt;&amp;lt;/div&gt;&amp;lt;/div&gt;
  290. &amp;lt;/div&gt;
  291. * &lt;/code&gt;&lt;/pre&gt;
  292. */
  293. <span id='Ext-Panel-cfg-border'> /**
  294. </span> * @cfg {Boolean} border
  295. * True to display the borders of the panel's body element, false to hide them (defaults to true). By default,
  296. * the border is a 2px wide inset border, but this can be further altered by setting {@link #bodyBorder} to false.
  297. */
  298. <span id='Ext-Panel-cfg-bodyBorder'> /**
  299. </span> * @cfg {Boolean} bodyBorder
  300. * True to display an interior border on the body element of the panel, false to hide it (defaults to true).
  301. * This only applies when {@link #border} == true. If border == true and bodyBorder == false, the border will display
  302. * as a 1px wide inset border, giving the entire body element an inset appearance.
  303. */
  304. <span id='Ext-Panel-cfg-bodyCssClass'> /**
  305. </span> * @cfg {String/Object/Function} bodyCssClass
  306. * Additional css class selector to be applied to the {@link #body} element in the format expected by
  307. * {@link Ext.Element#addClass} (defaults to null). See {@link #bodyCfg}.
  308. */
  309. <span id='Ext-Panel-cfg-bodyStyle'> /**
  310. </span> * @cfg {String/Object/Function} bodyStyle
  311. * Custom CSS styles to be applied to the {@link #body} element in the format expected by
  312. * {@link Ext.Element#applyStyles} (defaults to null). See {@link #bodyCfg}.
  313. */
  314. <span id='Ext-Panel-cfg-iconCls'> /**
  315. </span> * @cfg {String} iconCls
  316. * The CSS class selector that specifies a background image to be used as the header icon (defaults to '').
  317. * &lt;p&gt;An example of specifying a custom icon class would be something like:
  318. * &lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  319. // specify the property in the config for the class:
  320. ...
  321. iconCls: 'my-icon'
  322. // css class that specifies background image to be used as the icon image:
  323. .my-icon { background-image: url(../images/my-icon.gif) 0 6px no-repeat !important; }
  324. &lt;/code&gt;&lt;/pre&gt;
  325. */
  326. <span id='Ext-Panel-cfg-collapsible'> /**
  327. </span> * @cfg {Boolean} collapsible
  328. * True to make the panel collapsible and have the expand/collapse toggle button automatically rendered into
  329. * the header tool button area, false to keep the panel statically sized with no button (defaults to false).
  330. */
  331. <span id='Ext-Panel-cfg-tools'> /**
  332. </span> * @cfg {Array} tools
  333. * An array of tool button configs to be added to the header tool area. When rendered, each tool is
  334. * stored as an {@link Ext.Element Element} referenced by a public property called &lt;code&gt;&lt;b&gt;&lt;/b&gt;tools.&lt;i&gt;&amp;lt;tool-type&amp;gt;&lt;/i&gt;&lt;/code&gt;
  335. * &lt;p&gt;Each tool config may contain the following properties:
  336. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  337. * &lt;li&gt;&lt;b&gt;id&lt;/b&gt; : String&lt;div class=&quot;sub-desc&quot;&gt;&lt;b&gt;Required.&lt;/b&gt; The type
  338. * of tool to create. By default, this assigns a CSS class of the form &lt;code&gt;x-tool-&lt;i&gt;&amp;lt;tool-type&amp;gt;&lt;/i&gt;&lt;/code&gt; to the
  339. * resulting tool Element. Ext provides CSS rules, and an icon sprite containing images for the tool types listed below.
  340. * The developer may implement custom tools by supplying alternate CSS rules and background images:
  341. * &lt;ul&gt;
  342. * &lt;div class=&quot;x-tool x-tool-toggle&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; toggle&lt;/code&gt; (Created by default when {@link #collapsible} is &lt;code&gt;true&lt;/code&gt;)&lt;/div&gt;
  343. * &lt;div class=&quot;x-tool x-tool-close&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; close&lt;/code&gt;&lt;/div&gt;
  344. * &lt;div class=&quot;x-tool x-tool-minimize&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; minimize&lt;/code&gt;&lt;/div&gt;
  345. * &lt;div class=&quot;x-tool x-tool-maximize&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; maximize&lt;/code&gt;&lt;/div&gt;
  346. * &lt;div class=&quot;x-tool x-tool-restore&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; restore&lt;/code&gt;&lt;/div&gt;
  347. * &lt;div class=&quot;x-tool x-tool-gear&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; gear&lt;/code&gt;&lt;/div&gt;
  348. * &lt;div class=&quot;x-tool x-tool-pin&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; pin&lt;/code&gt;&lt;/div&gt;
  349. * &lt;div class=&quot;x-tool x-tool-unpin&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; unpin&lt;/code&gt;&lt;/div&gt;
  350. * &lt;div class=&quot;x-tool x-tool-right&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; right&lt;/code&gt;&lt;/div&gt;
  351. * &lt;div class=&quot;x-tool x-tool-left&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; left&lt;/code&gt;&lt;/div&gt;
  352. * &lt;div class=&quot;x-tool x-tool-up&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; up&lt;/code&gt;&lt;/div&gt;
  353. * &lt;div class=&quot;x-tool x-tool-down&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; down&lt;/code&gt;&lt;/div&gt;
  354. * &lt;div class=&quot;x-tool x-tool-refresh&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; refresh&lt;/code&gt;&lt;/div&gt;
  355. * &lt;div class=&quot;x-tool x-tool-minus&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; minus&lt;/code&gt;&lt;/div&gt;
  356. * &lt;div class=&quot;x-tool x-tool-plus&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; plus&lt;/code&gt;&lt;/div&gt;
  357. * &lt;div class=&quot;x-tool x-tool-help&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; help&lt;/code&gt;&lt;/div&gt;
  358. * &lt;div class=&quot;x-tool x-tool-search&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; search&lt;/code&gt;&lt;/div&gt;
  359. * &lt;div class=&quot;x-tool x-tool-save&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; save&lt;/code&gt;&lt;/div&gt;
  360. * &lt;div class=&quot;x-tool x-tool-print&quot; style=&quot;float:left; margin-right:5;&quot;&gt; &lt;/div&gt;&lt;div&gt;&lt;code&gt; print&lt;/code&gt;&lt;/div&gt;
  361. * &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
  362. * &lt;li&gt;&lt;b&gt;handler&lt;/b&gt; : Function&lt;div class=&quot;sub-desc&quot;&gt;&lt;b&gt;Required.&lt;/b&gt; The function to
  363. * call when clicked. Arguments passed are:&lt;ul&gt;
  364. * &lt;li&gt;&lt;b&gt;event&lt;/b&gt; : Ext.EventObject&lt;div class=&quot;sub-desc&quot;&gt;The click event.&lt;/div&gt;&lt;/li&gt;
  365. * &lt;li&gt;&lt;b&gt;toolEl&lt;/b&gt; : Ext.Element&lt;div class=&quot;sub-desc&quot;&gt;The tool Element.&lt;/div&gt;&lt;/li&gt;
  366. * &lt;li&gt;&lt;b&gt;panel&lt;/b&gt; : Ext.Panel&lt;div class=&quot;sub-desc&quot;&gt;The host Panel&lt;/div&gt;&lt;/li&gt;
  367. * &lt;li&gt;&lt;b&gt;tc&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The tool configuration object&lt;/div&gt;&lt;/li&gt;
  368. * &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
  369. * &lt;li&gt;&lt;b&gt;stopEvent&lt;/b&gt; : Boolean&lt;div class=&quot;sub-desc&quot;&gt;Defaults to true. Specify as false to allow click event to propagate.&lt;/div&gt;&lt;/li&gt;
  370. * &lt;li&gt;&lt;b&gt;scope&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;The scope in which to call the handler.&lt;/div&gt;&lt;/li&gt;
  371. * &lt;li&gt;&lt;b&gt;qtip&lt;/b&gt; : String/Object&lt;div class=&quot;sub-desc&quot;&gt;A tip string, or
  372. * a config argument to {@link Ext.QuickTip#register}&lt;/div&gt;&lt;/li&gt;
  373. * &lt;li&gt;&lt;b&gt;hidden&lt;/b&gt; : Boolean&lt;div class=&quot;sub-desc&quot;&gt;True to initially render hidden.&lt;/div&gt;&lt;/li&gt;
  374. * &lt;li&gt;&lt;b&gt;on&lt;/b&gt; : Object&lt;div class=&quot;sub-desc&quot;&gt;A listener config object specifiying
  375. * event listeners in the format of an argument to {@link #addListener}&lt;/div&gt;&lt;/li&gt;
  376. * &lt;/ul&gt;&lt;/div&gt;
  377. * &lt;p&gt;Note that, apart from the toggle tool which is provided when a panel is collapsible, these
  378. * tools only provide the visual button. Any required functionality must be provided by adding
  379. * handlers that implement the necessary behavior.&lt;/p&gt;
  380. * &lt;p&gt;Example usage:&lt;/p&gt;
  381. * &lt;pre&gt;&lt;code&gt;
  382. tools:[{
  383. id:'refresh',
  384. qtip: 'Refresh form Data',
  385. // hidden:true,
  386. handler: function(event, toolEl, panel){
  387. // refresh logic
  388. }
  389. },
  390. {
  391. id:'help',
  392. qtip: 'Get Help',
  393. handler: function(event, toolEl, panel){
  394. // whatever
  395. }
  396. }]
  397. &lt;/code&gt;&lt;/pre&gt;
  398. * &lt;p&gt;For the custom id of &lt;code&gt;'help'&lt;/code&gt; define two relevant css classes with a link to
  399. * a 15x15 image:&lt;/p&gt;
  400. * &lt;pre&gt;&lt;code&gt;
  401. .x-tool-help {background-image: url(images/help.png);}
  402. .x-tool-help-over {background-image: url(images/help_over.png);}
  403. // if using an image sprite:
  404. .x-tool-help {background-image: url(images/help.png) no-repeat 0 0;}
  405. .x-tool-help-over {background-position:-15px 0;}
  406. &lt;/code&gt;&lt;/pre&gt;
  407. */
  408. <span id='Ext-Panel-cfg-toolTemplate'> /**
  409. </span> * @cfg {Ext.Template/Ext.XTemplate} toolTemplate
  410. * &lt;p&gt;A Template used to create {@link #tools} in the {@link #header} Element. Defaults to:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  411. new Ext.Template('&amp;lt;div class=&quot;x-tool x-tool-{id}&quot;&gt;&amp;amp;#160;&amp;lt;/div&gt;')&lt;/code&gt;&lt;/pre&gt;
  412. * &lt;p&gt;This may may be overridden to provide a custom DOM structure for tools based upon a more
  413. * complex XTemplate. The template's data is a single tool configuration object (Not the entire Array)
  414. * as specified in {@link #tools}. In the following example an &amp;lt;a&gt; tag is used to provide a
  415. * visual indication when hovering over the tool:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  416. var win = new Ext.Window({
  417. tools: [{
  418. id: 'download',
  419. href: '/MyPdfDoc.pdf'
  420. }],
  421. toolTemplate: new Ext.XTemplate(
  422. '&amp;lt;tpl if=&quot;id==\'download\'&quot;&gt;',
  423. '&amp;lt;a class=&quot;x-tool x-tool-pdf&quot; href=&quot;{href}&quot;&gt;&amp;lt;/a&gt;',
  424. '&amp;lt;/tpl&gt;',
  425. '&amp;lt;tpl if=&quot;id!=\'download\'&quot;&gt;',
  426. '&amp;lt;div class=&quot;x-tool x-tool-{id}&quot;&gt;&amp;amp;#160;&amp;lt;/div&gt;',
  427. '&amp;lt;/tpl&gt;'
  428. ),
  429. width:500,
  430. height:300,
  431. closeAction:'hide'
  432. });&lt;/code&gt;&lt;/pre&gt;
  433. * &lt;p&gt;Note that the CSS class 'x-tool-pdf' should have an associated style rule which provides an
  434. * appropriate background image, something like:&lt;/p&gt;
  435. &lt;pre&gt;&lt;code&gt;
  436. a.x-tool-pdf {background-image: url(../shared/extjs/images/pdf.gif)!important;}
  437. &lt;/code&gt;&lt;/pre&gt;
  438. */
  439. <span id='Ext-Panel-cfg-hideCollapseTool'> /**
  440. </span> * @cfg {Boolean} hideCollapseTool
  441. * &lt;code&gt;true&lt;/code&gt; to hide the expand/collapse toggle button when &lt;code&gt;{@link #collapsible} == true&lt;/code&gt;,
  442. * &lt;code&gt;false&lt;/code&gt; to display it (defaults to &lt;code&gt;false&lt;/code&gt;).
  443. */
  444. <span id='Ext-Panel-cfg-titleCollapse'> /**
  445. </span> * @cfg {Boolean} titleCollapse
  446. * &lt;code&gt;true&lt;/code&gt; to allow expanding and collapsing the panel (when &lt;code&gt;{@link #collapsible} = true&lt;/code&gt;)
  447. * by clicking anywhere in the header bar, &lt;code&gt;false&lt;/code&gt;) to allow it only by clicking to tool button
  448. * (defaults to &lt;code&gt;false&lt;/code&gt;)). If this panel is a child item of a border layout also see the
  449. * {@link Ext.layout.BorderLayout.Region BorderLayout.Region}
  450. * &lt;code&gt;{@link Ext.layout.BorderLayout.Region#floatable floatable}&lt;/code&gt; config option.
  451. */
  452. <span id='Ext-Panel-cfg-floating'> /**
  453. </span> * @cfg {Mixed} floating
  454. * &lt;p&gt;This property is used to configure the underlying {@link Ext.Layer}. Acceptable values for this
  455. * configuration property are:&lt;/p&gt;&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  456. * &lt;li&gt;&lt;b&gt;&lt;code&gt;false&lt;/code&gt;&lt;/b&gt; : &lt;b&gt;Default.&lt;/b&gt;&lt;div class=&quot;sub-desc&quot;&gt;Display the panel inline where it is
  457. * rendered.&lt;/div&gt;&lt;/li&gt;
  458. * &lt;li&gt;&lt;b&gt;&lt;code&gt;true&lt;/code&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;Float the panel (absolute position it with automatic
  459. * shimming and shadow).&lt;ul&gt;
  460. * &lt;div class=&quot;sub-desc&quot;&gt;Setting floating to true will create an Ext.Layer for this panel and display the
  461. * panel at negative offsets so that it is hidden.&lt;/div&gt;
  462. * &lt;div class=&quot;sub-desc&quot;&gt;Since the panel will be absolute positioned, the position must be set explicitly
  463. * &lt;i&gt;after&lt;/i&gt; render (e.g., &lt;code&gt;myPanel.setPosition(100,100);&lt;/code&gt;).&lt;/div&gt;
  464. * &lt;div class=&quot;sub-desc&quot;&gt;&lt;b&gt;Note&lt;/b&gt;: when floating a panel you should always assign a fixed width,
  465. * otherwise it will be auto width and will expand to fill to the right edge of the viewport.&lt;/div&gt;
  466. * &lt;/ul&gt;&lt;/div&gt;&lt;/li&gt;
  467. * &lt;li&gt;&lt;b&gt;&lt;code&gt;{@link Ext.Layer object}&lt;/code&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;The specified object will be used
  468. * as the configuration object for the {@link Ext.Layer} that will be created.&lt;/div&gt;&lt;/li&gt;
  469. * &lt;/ul&gt;&lt;/div&gt;
  470. */
  471. <span id='Ext-Panel-cfg-shadow'> /**
  472. </span> * @cfg {Boolean/String} shadow
  473. * &lt;code&gt;true&lt;/code&gt; (or a valid Ext.Shadow {@link Ext.Shadow#mode} value) to display a shadow behind the
  474. * panel, &lt;code&gt;false&lt;/code&gt; to display no shadow (defaults to &lt;code&gt;'sides'&lt;/code&gt;). Note that this option
  475. * only applies when &lt;code&gt;{@link #floating} = true&lt;/code&gt;.
  476. */
  477. <span id='Ext-Panel-cfg-shadowOffset'> /**
  478. </span> * @cfg {Number} shadowOffset
  479. * The number of pixels to offset the shadow if displayed (defaults to &lt;code&gt;4&lt;/code&gt;). Note that this
  480. * option only applies when &lt;code&gt;{@link #floating} = true&lt;/code&gt;.
  481. */
  482. <span id='Ext-Panel-cfg-shim'> /**
  483. </span> * @cfg {Boolean} shim
  484. * &lt;code&gt;false&lt;/code&gt; to disable the iframe shim in browsers which need one (defaults to &lt;code&gt;true&lt;/code&gt;).
  485. * Note that this option only applies when &lt;code&gt;{@link #floating} = true&lt;/code&gt;.
  486. */
  487. <span id='Ext-Panel-cfg-keys'> /**
  488. </span> * @cfg {Object/Array} keys
  489. * A {@link Ext.KeyMap} config object (in the format expected by {@link Ext.KeyMap#addBinding}
  490. * used to assign custom key handling to this panel (defaults to &lt;code&gt;null&lt;/code&gt;).
  491. */
  492. <span id='Ext-Panel-cfg-draggable'> /**
  493. </span> * @cfg {Boolean/Object} draggable
  494. * &lt;p&gt;&lt;code&gt;true&lt;/code&gt; to enable dragging of this Panel (defaults to &lt;code&gt;false&lt;/code&gt;).&lt;/p&gt;
  495. * &lt;p&gt;For custom drag/drop implementations, an &lt;b&gt;Ext.Panel.DD&lt;/b&gt; config could also be passed
  496. * in this config instead of &lt;code&gt;true&lt;/code&gt;. Ext.Panel.DD is an internal, undocumented class which
  497. * moves a proxy Element around in place of the Panel's element, but provides no other behaviour
  498. * during dragging or on drop. It is a subclass of {@link Ext.dd.DragSource}, so behaviour may be
  499. * added by implementing the interface methods of {@link Ext.dd.DragDrop} e.g.:
  500. * &lt;pre&gt;&lt;code&gt;
  501. new Ext.Panel({
  502. title: 'Drag me',
  503. x: 100,
  504. y: 100,
  505. renderTo: Ext.getBody(),
  506. floating: true,
  507. frame: true,
  508. width: 400,
  509. height: 200,
  510. draggable: {
  511. // Config option of Ext.Panel.DD class.
  512. // It&amp;#39;s a floating Panel, so do not show a placeholder proxy in the original position.
  513. insertProxy: false,
  514. // Called for each mousemove event while dragging the DD object.
  515. onDrag : function(e){
  516. // Record the x,y position of the drag proxy so that we can
  517. // position the Panel at end of drag.
  518. var pel = this.proxy.getEl();
  519. this.x = pel.getLeft(true);
  520. this.y = pel.getTop(true);
  521. // Keep the Shadow aligned if there is one.
  522. var s = this.panel.getEl().shadow;
  523. if (s) {
  524. s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
  525. }
  526. },
  527. // Called on the mouseup event.
  528. endDrag : function(e){
  529. this.panel.setPosition(this.x, this.y);
  530. }
  531. }
  532. }).show();
  533. &lt;/code&gt;&lt;/pre&gt;
  534. */
  535. <span id='Ext-Panel-cfg-disabled'> /**
  536. </span> * @cfg {Boolean} disabled
  537. * Render this panel disabled (default is &lt;code&gt;false&lt;/code&gt;). An important note when using the disabled
  538. * config on panels is that IE will often fail to initialize the disabled mask element correectly if
  539. * the panel's layout has not yet completed by the time the Panel is disabled during the render process.
  540. * If you experience this issue, you may need to instead use the {@link #afterlayout} event to initialize
  541. * the disabled state:
  542. * &lt;pre&gt;&lt;code&gt;
  543. new Ext.Panel({
  544. ...
  545. listeners: {
  546. 'afterlayout': {
  547. fn: function(p){
  548. p.disable();
  549. },
  550. single: true // important, as many layouts can occur
  551. }
  552. }
  553. });
  554. &lt;/code&gt;&lt;/pre&gt;
  555. */
  556. <span id='Ext-Panel-cfg-autoHeight'> /**
  557. </span> * @cfg {Boolean} autoHeight
  558. * &lt;code&gt;true&lt;/code&gt; to use height:'auto', &lt;code&gt;false&lt;/code&gt; to use fixed height (defaults to &lt;code&gt;false&lt;/code&gt;).
  559. * &lt;b&gt;Note&lt;/b&gt;: Setting &lt;code&gt;autoHeight: true&lt;/code&gt; means that the browser will manage the panel's height
  560. * based on its contents, and that Ext will not manage it at all. If the panel is within a layout that
  561. * manages dimensions (&lt;code&gt;fit&lt;/code&gt;, &lt;code&gt;border&lt;/code&gt;, etc.) then setting &lt;code&gt;autoHeight: true&lt;/code&gt;
  562. * can cause issues with scrolling and will not generally work as expected since the panel will take
  563. * on the height of its contents rather than the height required by the Ext layout.
  564. */
  565. <span id='Ext-Panel-cfg-baseCls'> /**
  566. </span> * @cfg {String} baseCls
  567. * The base CSS class to apply to this panel's element (defaults to &lt;code&gt;'x-panel'&lt;/code&gt;).
  568. * &lt;p&gt;Another option available by default is to specify &lt;code&gt;'x-plain'&lt;/code&gt; which strips all styling
  569. * except for required attributes for Ext layouts to function (e.g. overflow:hidden).
  570. * See &lt;code&gt;{@link #unstyled}&lt;/code&gt; also.&lt;/p&gt;
  571. */
  572. baseCls : 'x-panel',
  573. <span id='Ext-Panel-cfg-collapsedCls'> /**
  574. </span> * @cfg {String} collapsedCls
  575. * A CSS class to add to the panel's element after it has been collapsed (defaults to
  576. * &lt;code&gt;'x-panel-collapsed'&lt;/code&gt;).
  577. */
  578. collapsedCls : 'x-panel-collapsed',
  579. <span id='Ext-Panel-cfg-maskDisabled'> /**
  580. </span> * @cfg {Boolean} maskDisabled
  581. * &lt;code&gt;true&lt;/code&gt; to mask the panel when it is {@link #disabled}, &lt;code&gt;false&lt;/code&gt; to not mask it (defaults
  582. * to &lt;code&gt;true&lt;/code&gt;). Either way, the panel will always tell its contained elements to disable themselves
  583. * when it is disabled, but masking the panel can provide an additional visual cue that the panel is
  584. * disabled.
  585. */
  586. maskDisabled : true,
  587. <span id='Ext-Panel-cfg-animCollapse'> /**
  588. </span> * @cfg {Boolean} animCollapse
  589. * &lt;code&gt;true&lt;/code&gt; to animate the transition when the panel is collapsed, &lt;code&gt;false&lt;/code&gt; to skip the
  590. * animation (defaults to &lt;code&gt;true&lt;/code&gt; if the {@link Ext.Fx} class is available, otherwise &lt;code&gt;false&lt;/code&gt;).
  591. */
  592. animCollapse : Ext.enableFx,
  593. <span id='Ext-Panel-cfg-headerAsText'> /**
  594. </span> * @cfg {Boolean} headerAsText
  595. * &lt;code&gt;true&lt;/code&gt; to display the panel &lt;code&gt;{@link #title}&lt;/code&gt; in the &lt;code&gt;{@link #header}&lt;/code&gt;,
  596. * &lt;code&gt;false&lt;/code&gt; to hide it (defaults to &lt;code&gt;true&lt;/code&gt;).
  597. */
  598. headerAsText : true,
  599. <span id='Ext-Panel-cfg-buttonAlign'> /**
  600. </span> * @cfg {String} buttonAlign
  601. * The alignment of any {@link #buttons} added to this panel. Valid values are &lt;code&gt;'right'&lt;/code&gt;,
  602. * &lt;code&gt;'left'&lt;/code&gt; and &lt;code&gt;'center'&lt;/code&gt; (defaults to &lt;code&gt;'right'&lt;/code&gt;).
  603. */
  604. buttonAlign : 'right',
  605. <span id='Ext-Panel-cfg-collapsed'> /**
  606. </span> * @cfg {Boolean} collapsed
  607. * &lt;code&gt;true&lt;/code&gt; to render the panel collapsed, &lt;code&gt;false&lt;/code&gt; to render it expanded (defaults to
  608. * &lt;code&gt;false&lt;/code&gt;).
  609. */
  610. collapsed : false,
  611. <span id='Ext-Panel-cfg-collapseFirst'> /**
  612. </span> * @cfg {Boolean} collapseFirst
  613. * &lt;code&gt;true&lt;/code&gt; to make sure the collapse/expand toggle button always renders first (to the left of)
  614. * any other tools in the panel's title bar, &lt;code&gt;false&lt;/code&gt; to render it last (defaults to &lt;code&gt;true&lt;/code&gt;).
  615. */
  616. collapseFirst : true,
  617. <span id='Ext-Panel-cfg-minButtonWidth'> /**
  618. </span> * @cfg {Number} minButtonWidth
  619. * Minimum width in pixels of all {@link #buttons} in this panel (defaults to &lt;code&gt;75&lt;/code&gt;)
  620. */
  621. minButtonWidth : 75,
  622. <span id='Ext-Panel-cfg-unstyled'> /**
  623. </span> * @cfg {Boolean} unstyled
  624. * Overrides the &lt;code&gt;{@link #baseCls}&lt;/code&gt; setting to &lt;code&gt;{@link #baseCls} = 'x-plain'&lt;/code&gt; which renders
  625. * the panel unstyled except for required attributes for Ext layouts to function (e.g. overflow:hidden).
  626. */
  627. <span id='Ext-Panel-cfg-elements'> /**
  628. </span> * @cfg {String} elements
  629. * A comma-delimited list of panel elements to initialize when the panel is rendered. Normally, this list will be
  630. * generated automatically based on the items added to the panel at config time, but sometimes it might be useful to
  631. * make sure a structural element is rendered even if not specified at config time (for example, you may want
  632. * to add a button or toolbar dynamically after the panel has been rendered). Adding those elements to this
  633. * list will allocate the required placeholders in the panel when it is rendered. Valid values are&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  634. * &lt;li&gt;&lt;code&gt;header&lt;/code&gt;&lt;/li&gt;
  635. * &lt;li&gt;&lt;code&gt;tbar&lt;/code&gt; (top bar)&lt;/li&gt;
  636. * &lt;li&gt;&lt;code&gt;body&lt;/code&gt;&lt;/li&gt;
  637. * &lt;li&gt;&lt;code&gt;bbar&lt;/code&gt; (bottom bar)&lt;/li&gt;
  638. * &lt;li&gt;&lt;code&gt;footer&lt;/code&gt;&lt;/li&gt;
  639. * &lt;/ul&gt;&lt;/div&gt;
  640. * Defaults to '&lt;code&gt;body&lt;/code&gt;'.
  641. */
  642. elements : 'body',
  643. <span id='Ext-Panel-cfg-preventBodyReset'> /**
  644. </span> * @cfg {Boolean} preventBodyReset
  645. * Defaults to &lt;code&gt;false&lt;/code&gt;. When set to &lt;code&gt;true&lt;/code&gt;, an extra css class &lt;code&gt;'x-panel-normal'&lt;/code&gt;
  646. * will be added to the panel's element, effectively applying css styles suggested by the W3C
  647. * (see http://www.w3.org/TR/CSS21/sample.html) to the Panel's &lt;b&gt;body&lt;/b&gt; element (not the header,
  648. * footer, etc.).
  649. */
  650. preventBodyReset : false,
  651. <span id='Ext-Panel-cfg-padding'> /**
  652. </span> * @cfg {Number/String} padding
  653. * A shortcut for setting a padding style on the body element. The value can either be
  654. * a number to be applied to all sides, or a normal css string describing padding.
  655. * Defaults to &lt;tt&gt;undefined&lt;/tt&gt;.
  656. *
  657. */
  658. padding: undefined,
  659. <span id='Ext-Panel-cfg-resizeEvent'> /** @cfg {String} resizeEvent
  660. </span> * The event to listen to for resizing in layouts. Defaults to &lt;tt&gt;'bodyresize'&lt;/tt&gt;.
  661. */
  662. resizeEvent: 'bodyresize',
  663. <span id='Ext-Panel-property-toolTarget'> // protected - these could be used to customize the behavior of the window,
  664. </span> // but changing them would not be useful without further mofifications and
  665. // could lead to unexpected or undesirable results.
  666. toolTarget : 'header',
  667. <span id='Ext-Panel-property-collapseEl'> collapseEl : 'bwrap',
  668. </span><span id='Ext-Panel-property-slideAnchor'> slideAnchor : 't',
  669. </span><span id='Ext-Panel-cfg-disabledClass'> disabledClass : '',
  670. </span>
  671. <span id='Ext-Panel-property-deferHeight'> // private, notify box this class will handle heights
  672. </span> deferHeight : true,
  673. <span id='Ext-Panel-property-expandDefaults'> // private
  674. </span> expandDefaults: {
  675. duration : 0.25
  676. },
  677. <span id='Ext-Panel-property-collapseDefaults'> // private
  678. </span> collapseDefaults : {
  679. duration : 0.25
  680. },
  681. <span id='Ext-Panel-method-initComponent'> // private
  682. </span> initComponent : function(){
  683. Ext.Panel.superclass.initComponent.call(this);
  684. this.addEvents(
  685. <span id='Ext-Panel-event-bodyresize'> /**
  686. </span> * @event bodyresize
  687. * Fires after the Panel has been resized.
  688. * @param {Ext.Panel} p the Panel which has been resized.
  689. * @param {Number} width The Panel body's new width.
  690. * @param {Number} height The Panel body's new height.
  691. */
  692. 'bodyresize',
  693. <span id='Ext-Panel-event-titlechange'> /**
  694. </span> * @event titlechange
  695. * Fires after the Panel title has been {@link #title set} or {@link #setTitle changed}.
  696. * @param {Ext.Panel} p the Panel which has had its title changed.
  697. * @param {String} The new title.
  698. */
  699. 'titlechange',
  700. <span id='Ext-Panel-event-iconchange'> /**
  701. </span> * @event iconchange
  702. * Fires after the Panel icon class has been {@link #iconCls set} or {@link #setIconClass changed}.
  703. * @param {Ext.Panel} p the Panel which has had its {@link #iconCls icon class} changed.
  704. * @param {String} newIcon The new icon class.
  705. * @param {String} oldIcon The old icon class.
  706. */
  707. 'iconchange',
  708. <span id='Ext-Panel-event-collapse'> /**
  709. </span> * @event collapse
  710. * Fires after the Panel has been collapsed.
  711. * @param {Ext.Panel} p the Panel that has been collapsed.
  712. */
  713. 'collapse',
  714. <span id='Ext-Panel-event-expand'> /**
  715. </span> * @event expand
  716. * Fires after the Panel has been expanded.
  717. * @param {Ext.Panel} p The Panel that has been expanded.
  718. */
  719. 'expand',
  720. <span id='Ext-Panel-event-beforecollapse'> /**
  721. </span> * @event beforecollapse
  722. * Fires before the Panel is collapsed. A handler can return false to cancel the collapse.
  723. * @param {Ext.Panel} p the Panel being collapsed.
  724. * @param {Boolean} animate True if the collapse is animated, else false.
  725. */
  726. 'beforecollapse',
  727. <span id='Ext-Panel-event-beforeexpand'> /**
  728. </span> * @event beforeexpand
  729. * Fires before the Panel is expanded. A handler can return false to cancel the expand.
  730. * @param {Ext.Panel} p The Panel being expanded.
  731. * @param {Boolean} animate True if the expand is animated, else false.
  732. */
  733. 'beforeexpand',
  734. <span id='Ext-Panel-event-beforeclose'> /**
  735. </span> * @event beforeclose
  736. * Fires before the Panel is closed. Note that Panels do not directly support being closed, but some
  737. * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel. This event only
  738. * applies to such subclasses.
  739. * A handler can return false to cancel the close.
  740. * @param {Ext.Panel} p The Panel being closed.
  741. */
  742. 'beforeclose',
  743. <span id='Ext-Panel-event-close'> /**
  744. </span> * @event close
  745. * Fires after the Panel is closed. Note that Panels do not directly support being closed, but some
  746. * Panel subclasses do (like {@link Ext.Window}) or a Panel within a Ext.TabPanel.
  747. * @param {Ext.Panel} p The Panel that has been closed.
  748. */
  749. 'close',
  750. <span id='Ext-Panel-event-activate'> /**
  751. </span> * @event activate
  752. * Fires after the Panel has been visually activated.
  753. * Note that Panels do not directly support being activated, but some Panel subclasses
  754. * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
  755. * activate and deactivate events under the control of the TabPanel.
  756. * @param {Ext.Panel} p The Panel that has been activated.
  757. */
  758. 'activate',
  759. <span id='Ext-Panel-event-deactivate'> /**
  760. </span> * @event deactivate
  761. * Fires after the Panel has been visually deactivated.
  762. * Note that Panels do not directly support being deactivated, but some Panel subclasses
  763. * do (like {@link Ext.Window}). Panels which are child Components of a TabPanel fire the
  764. * activate and deactivate events under the control of the TabPanel.
  765. * @param {Ext.Panel} p The Panel that has been deactivated.
  766. */
  767. 'deactivate'
  768. );
  769. if(this.unstyled){
  770. this.baseCls = 'x-plain';
  771. }
  772. this.toolbars = [];
  773. // shortcuts
  774. if(this.tbar){
  775. this.elements += ',tbar';
  776. this.topToolbar = this.createToolbar(this.tbar);
  777. this.tbar = null;
  778. }
  779. if(this.bbar){
  780. this.elements += ',bbar';
  781. this.bottomToolbar = this.createToolbar(this.bbar);
  782. this.bbar = null;
  783. }
  784. if(this.header === true){
  785. this.elements += ',header';
  786. this.header = null;
  787. }else if(this.headerCfg || (this.title &amp;&amp; this.header !== false)){
  788. this.elements += ',header';
  789. }
  790. if(this.footerCfg || this.footer === true){
  791. this.elements += ',footer';
  792. this.footer = null;
  793. }
  794. if(this.buttons){
  795. this.fbar = this.buttons;
  796. this.buttons = null;
  797. }
  798. if(this.fbar){
  799. this.createFbar(this.fbar);
  800. }
  801. if(this.autoLoad){
  802. this.on('render', this.doAutoLoad, this, {delay:10});
  803. }
  804. },
  805. <span id='Ext-Panel-method-createFbar'> // private
  806. </span> createFbar : function(fbar){
  807. var min = this.minButtonWidth;
  808. this.elements += ',footer';
  809. this.fbar = this.createToolbar(fbar, {
  810. buttonAlign: this.buttonAlign,
  811. toolbarCls: 'x-panel-fbar',
  812. enableOverflow: false,
  813. defaults: function(c){
  814. return {
  815. minWidth: c.minWidth || min
  816. };
  817. }
  818. });
  819. // @compat addButton and buttons could possibly be removed
  820. // @target 4.0
  821. <span id='Ext-Panel-property-buttons'> /**
  822. </span> * This Panel's Array of buttons as created from the &lt;code&gt;{@link #buttons}&lt;/code&gt;
  823. * config property. Read only.
  824. * @type Array
  825. * @property buttons
  826. */
  827. this.fbar.items.each(function(c){
  828. c.minWidth = c.minWidth || this.minButtonWidth;
  829. }, this);
  830. this.buttons = this.fbar.items.items;
  831. },
  832. <span id='Ext-Panel-method-createToolbar'> // private
  833. </span> createToolbar: function(tb, options){
  834. var result;
  835. // Convert array to proper toolbar config
  836. if(Ext.isArray(tb)){
  837. tb = {
  838. items: tb
  839. };
  840. }
  841. result = tb.events ? Ext.apply(tb, options) : this.createComponent(Ext.apply({}, tb, options), 'toolbar');
  842. this.toolbars.push(result);
  843. return result;
  844. },
  845. <span id='Ext-Panel-method-createElement'> // private
  846. </span> createElement : function(name, pnode){
  847. if(this[name]){
  848. pnode.appendChild(this[name].dom);
  849. return;
  850. }
  851. if(name === 'bwrap' || this.elements.indexOf(name) != -1){
  852. if(this[name+'Cfg']){
  853. this[name] = Ext.fly(pnode).createChild(this[name+'Cfg']);
  854. }else{
  855. var el = document.createElement('div');
  856. el.className = this[name+'Cls'];
  857. this[name] = Ext.get(pnode.appendChild(el));
  858. }
  859. if(this[name+'CssClass']){
  860. this[name].addClass(this[name+'CssClass']);
  861. }
  862. if(this[name+'Style']){
  863. this[name].applyStyles(this[name+'Style']);
  864. }
  865. }
  866. },
  867. <span id='Ext-Panel-method-onRender'> // private
  868. </span> onRender : function(ct, position){
  869. Ext.Panel.superclass.onRender.call(this, ct, position);
  870. this.createClasses();
  871. var el = this.el,
  872. d = el.dom,
  873. bw,
  874. ts;
  875. if(this.collapsible &amp;&amp; !this.hideCollapseTool){
  876. this.tools = this.tools ? this.tools.slice(0) : [];
  877. this.tools[this.collapseFirst?'unshift':'push']({
  878. id: 'toggle',
  879. handler : this.toggleCollapse,
  880. scope: this
  881. });
  882. }
  883. if(this.tools){
  884. ts = this.tools;
  885. this.elements += (this.header !== false) ? ',header' : '';
  886. }
  887. this.tools = {};
  888. el.addClass(this.baseCls);
  889. if(d.firstChild){ // existing markup
  890. this.header = el.down('.'+this.headerCls);
  891. this.bwrap = el.down('.'+this.bwrapCls);
  892. var cp = this.bwrap ? this.bwrap : el;
  893. this.tbar = cp.down('.'+this.tbarCls);
  894. this.body = cp.down('.'+this.bodyCls);
  895. this.bbar = cp.down('.'+this.bbarCls);
  896. this.footer = cp.down('.'+this.footerCls);
  897. this.fromMarkup = true;
  898. }
  899. if (this.preventBodyReset === true) {
  900. el.addClass('x-panel-reset');
  901. }
  902. if(this.cls){
  903. el.addClass(this.cls);
  904. }
  905. if(this.buttons){
  906. this.elements += ',footer';
  907. }
  908. // This block allows for maximum flexibility and performance when using existing markup
  909. // framing requires special markup
  910. if(this.frame){
  911. el.insertHtml('afterBegin', String.format(Ext.Element.boxMarkup, this.baseCls));
  912. this.createElement('header', d.firstChild.firstChild.firstChild);
  913. this.createElement('bwrap', d);
  914. // append the mid and bottom frame to the bwrap
  915. bw = this.bwrap.dom;
  916. var ml = d.childNodes[1], bl = d.childNodes[2];
  917. bw.appendChild(ml);
  918. bw.appendChild(bl);
  919. var mc = bw.firstChild.firstChild.firstChild;
  920. this.createElement('tbar', mc);
  921. this.createElement('body', mc);
  922. this.createElement('bbar', mc);
  923. this.createElement('footer', bw.lastChild.firstChild.firstChild);
  924. if(!this.footer){
  925. this.bwrap.dom.lastChild.className += ' x-panel-nofooter';
  926. }
  927. /*
  928. * Store a reference to this element so:
  929. * a) We aren't looking it up all the time
  930. * b) The last element is reported incorrectly when using a loadmask
  931. */
  932. this.ft = Ext.get(this.bwrap.dom.lastChild);
  933. this.mc = Ext.get(mc);
  934. }else{
  935. this.createElement('header', d);
  936. this.createElement('bwrap', d);
  937. // append the mid and bottom frame to the bwrap
  938. bw = this.bwrap.dom;
  939. this.createElement('tbar', bw);
  940. this.createElement('body', bw);
  941. this.createElement('bbar', bw);
  942. this.createElement('footer', bw);
  943. if(!this.header){
  944. this.body.addClass(this.bodyCls + '-noheader');
  945. if(this.tbar){
  946. this.tbar.addClass(this.tbarCls + '-noheader');
  947. }
  948. }
  949. }
  950. if(Ext.isDefined(this.padding)){
  951. this.body.setStyle('padding', this.body.addUnits(this.padding));
  952. }
  953. if(this.border === false){
  954. this.el.addClass(this.baseCls + '-noborder');
  955. this.body.addClass(this.bodyCls + '-noborder');
  956. if(this.header){
  957. this.header.addClass(this.headerCls + '-noborder');
  958. }
  959. if(this.footer){
  960. this.footer.addClass(this.footerCls + '-noborder');
  961. }
  962. if(this.tbar){
  963. this.tbar.addClass(this.tbarCls + '-noborder');
  964. }
  965. if(this.bbar){
  966. this.bbar.addClass(this.bbarCls + '-noborder');
  967. }
  968. }
  969. if(this.bodyBorder === false){
  970. this.body.addClass(this.bodyCls + '-noborder');
  971. }
  972. this.bwrap.enableDisplayMode('block');
  973. if(this.header){
  974. this.header.unselectable();
  975. // for tools, we need to wrap any existing header markup
  976. if(this.headerAsText){
  977. this.header.dom.innerHTML =
  978. '&lt;span class=&quot;' + this.headerTextCls + '&quot;&gt;'+this.header.dom.innerHTML+'&lt;/span&gt;';
  979. if(this.iconCls){
  980. this.setIconClass(this.iconCls);
  981. }
  982. }
  983. }
  984. if(this.floating){
  985. this.makeFloating(this.floating);
  986. }
  987. if(this.collapsible &amp;&amp; this.titleCollapse &amp;&amp; this.header){
  988. this.mon(this.header, 'click', this.toggleCollapse, this);
  989. this.header.setStyle('cursor', 'pointer');
  990. }
  991. if(ts){
  992. this.addTool.apply(this, ts);
  993. }
  994. // Render Toolbars.
  995. if(this.fbar){
  996. this.footer.addClass('x-panel-btns');
  997. this.fbar.ownerCt = this;
  998. this.fbar.render(this.footer);
  999. this.footer.createChild({cls:'x-clear'});
  1000. }
  1001. if(this.tbar &amp;&amp; this.topToolbar){
  1002. this.topToolbar.ownerCt = this;
  1003. this.topToolbar.render(this.tbar);
  1004. }
  1005. if(this.bbar &amp;&amp; this.bottomToolbar){
  1006. this.bottomToolbar.ownerCt = this;
  1007. this.bottomToolbar.render(this.bbar);
  1008. }
  1009. },
  1010. <span id='Ext-Panel-method-setIconClass'> /**
  1011. </span> * Sets the CSS class that provides the icon image for this panel. This method will replace any existing
  1012. * icon class if one has already been set and fire the {@link #iconchange} event after completion.
  1013. * @param {String} cls The new CSS class name
  1014. */
  1015. setIconClass : function(cls){
  1016. var old = this.iconCls;
  1017. this.iconCls = cls;
  1018. if(this.rendered &amp;&amp; this.header){
  1019. if(this.frame){
  1020. this.header.addClass('x-panel-icon');
  1021. this.header.replaceClass(old, this.iconCls);
  1022. }else{
  1023. var hd = this.header,
  1024. img = hd.child('img.x-panel-inline-icon');
  1025. if(img){
  1026. Ext.fly(img).replaceClass(old, this.iconCls);
  1027. }else{
  1028. var hdspan = hd.child('span.' + this.headerTextCls);
  1029. if (hdspan) {
  1030. Ext.DomHelper.insertBefore(hdspan.dom, {
  1031. tag:'img', alt: '', src: Ext.BLANK_IMAGE_URL, cls:'x-panel-inline-icon '+this.iconCls
  1032. });
  1033. }
  1034. }
  1035. }
  1036. }
  1037. this.fireEvent('iconchange', this, cls, old);
  1038. },
  1039. <span id='Ext-Panel-method-makeFloating'> // private
  1040. </span> makeFloating : function(cfg){
  1041. this.floating = true;
  1042. this.el = new Ext.Layer(Ext.apply({}, cfg, {
  1043. shadow: Ext.isDefined(this.shadow) ? this.shadow : 'sides',
  1044. shadowOffset: this.shadowOffset,
  1045. constrain:false,
  1046. shim: this.shim === false ? false : undefined
  1047. }), this.el);
  1048. },
  1049. <span id='Ext-Panel-method-getTopToolbar'> /**
  1050. </span> * Returns the {@link Ext.Toolbar toolbar} from the top (&lt;code&gt;{@link #tbar}&lt;/code&gt;) section of the panel.
  1051. * @return {Ext.Toolbar} The toolbar
  1052. */
  1053. getTopToolbar : function(){
  1054. return this.topToolbar;
  1055. },
  1056. <span id='Ext-Panel-method-getBottomToolbar'> /**
  1057. </span> * Returns the {@link Ext.Toolbar toolbar} from the bottom (&lt;code&gt;{@link #bbar}&lt;/code&gt;) section of the panel.
  1058. * @return {Ext.Toolbar} The toolbar
  1059. */
  1060. getBottomToolbar : function(){
  1061. return this.bottomToolbar;
  1062. },
  1063. <span id='Ext-Panel-method-getFooterToolbar'> /**
  1064. </span> * Returns the {@link Ext.Toolbar toolbar} from the footer (&lt;code&gt;{@link #fbar}&lt;/code&gt;) section of the panel.
  1065. * @return {Ext.Toolbar} The toolbar
  1066. */
  1067. getFooterToolbar : function() {
  1068. return this.fbar;
  1069. },
  1070. <span id='Ext-Panel-method-addButton'> /**
  1071. </span> * Adds a button to this panel. Note that this method must be called prior to rendering. The preferred
  1072. * approach is to add buttons via the {@link #buttons} config.
  1073. * @param {String/Object} config A valid {@link Ext.Button} config. A string will become the text for a default
  1074. * button config, an object will be treated as a button config object.
  1075. * @param {Function} handler The function to be called on button {@link Ext.Button#click}
  1076. * @param {Object} scope The scope (&lt;code&gt;this&lt;/code&gt; reference) in which the button handler function is executed. Defaults to the Button.
  1077. * @return {Ext.Button} The button that was added
  1078. */
  1079. addButton : function(config, handler, scope){
  1080. if(!this.fbar){
  1081. this.createFbar([]);
  1082. }
  1083. if(handler){
  1084. if(Ext.isString(config)){
  1085. config = {text: config};
  1086. }
  1087. config = Ext.apply({
  1088. handler: handler,
  1089. scope: scope
  1090. }, config);
  1091. }
  1092. return this.fbar.add(config);
  1093. },
  1094. <span id='Ext-Panel-method-addTool'> // private
  1095. </span> addTool : function(){
  1096. if(!this.rendered){
  1097. if(!this.tools){
  1098. this.tools = [];
  1099. }
  1100. Ext.each(arguments, function(arg){
  1101. this.tools.push(arg);
  1102. }, this);
  1103. return;
  1104. }
  1105. // nowhere to render tools!
  1106. if(!this[this.toolTarget]){
  1107. return;
  1108. }
  1109. if(!this.toolTemplate){
  1110. // initialize the global tool template on first use
  1111. var tt = new Ext.Template(
  1112. '&lt;div class=&quot;x-tool x-tool-{id}&quot;&gt;&amp;#160;&lt;/div&gt;'
  1113. );
  1114. tt.disableFormats = true;
  1115. tt.compile();
  1116. Ext.Panel.prototype.toolTemplate = tt;
  1117. }
  1118. for(var i = 0, a = arguments, len = a.length; i &lt; len; i++) {
  1119. var tc = a[i];
  1120. if(!this.tools[tc.id]){
  1121. var overCls = 'x-tool-'+tc.id+'-over';
  1122. var t = this.toolTemplate.insertFirst(this[this.toolTarget], tc, true);
  1123. this.tools[tc.id] = t;
  1124. t.enableDisplayMode('block');
  1125. this.mon(t, 'click', this.createToolHandler(t, tc, overCls, this));
  1126. if(tc.on){
  1127. this.mon(t, tc.on);
  1128. }
  1129. if(tc.hidden){
  1130. t.hide();
  1131. }
  1132. if(tc.qtip){
  1133. if(Ext.isObject(tc.qtip)){
  1134. Ext.QuickTips.register(Ext.apply({
  1135. target: t.id
  1136. }, tc.qtip));
  1137. } else {
  1138. t.dom.qtip = tc.qtip;
  1139. }
  1140. }
  1141. t.addClassOnOver(overCls);
  1142. }
  1143. }
  1144. },
  1145. <span id='Ext-Panel-method-onLayout'> onLayout : function(shallow, force){
  1146. </span> Ext.Panel.superclass.onLayout.apply(this, arguments);
  1147. if(this.hasLayout &amp;&amp; this.toolbars.length &gt; 0){
  1148. Ext.each(this.toolbars, function(tb){
  1149. tb.doLayout(undefined, force);
  1150. });
  1151. this.syncHeight();
  1152. }
  1153. },
  1154. <span id='Ext-Panel-method-syncHeight'> syncHeight : function(){
  1155. </span> var h = this.toolbarHeight,
  1156. bd = this.body,
  1157. lsh = this.lastSize.height,
  1158. sz;
  1159. if(this.autoHeight || !Ext.isDefined(lsh) || lsh == 'auto'){
  1160. return;
  1161. }
  1162. if(h != this.getToolbarHeight()){
  1163. h = Math.max(0, lsh - this.getFrameHeight());
  1164. bd.setHeight(h);
  1165. sz = bd.getSize();
  1166. this.toolbarHeight = this.getToolbarHeight();
  1167. this.onBodyResize(sz.width, sz.height);
  1168. }
  1169. },
  1170. <span id='Ext-Panel-method-onShow'> // private
  1171. </span> onShow : function(){
  1172. if(this.floating){
  1173. return this.el.show();
  1174. }
  1175. Ext.Panel.superclass.onShow.call(this);
  1176. },
  1177. <span id='Ext-Panel-method-onHide'> // private
  1178. </span> onHide : function(){
  1179. if(this.floating){
  1180. return this.el.hide();
  1181. }
  1182. Ext.Panel.superclass.onHide.call(this);
  1183. },
  1184. <span id='Ext-Panel-method-createToolHandler'> // private
  1185. </span> createToolHandler : function(t, tc, overCls, panel){
  1186. return function(e){
  1187. t.removeClass(overCls);
  1188. if(tc.stopEvent !== false){
  1189. e.stopEvent();
  1190. }
  1191. if(tc.handler){
  1192. tc.handler.call(tc.scope || t, e, t, panel, tc);
  1193. }
  1194. };
  1195. },
  1196. <span id='Ext-Panel-method-afterRender'> // private
  1197. </span> afterRender : function(){
  1198. if(this.floating &amp;&amp; !this.hidden){
  1199. this.el.show();
  1200. }
  1201. if(this.title){
  1202. this.setTitle(this.title);
  1203. }
  1204. Ext.Panel.superclass.afterRender.call(this); // do sizing calcs last
  1205. if (this.collapsed) {
  1206. this.collapsed = false;
  1207. this.collapse(false);
  1208. }
  1209. this.initEvents();
  1210. },
  1211. <span id='Ext-Panel-method-getKeyMap'> // private
  1212. </span> getKeyMap : function(){
  1213. if(!this.keyMap){
  1214. this.keyMap = new Ext.KeyMap(this.el, this.keys);
  1215. }
  1216. return this.keyMap;
  1217. },
  1218. <span id='Ext-Panel-method-initEvents'> // private
  1219. </span> initEvents : function(){
  1220. if(this.keys){
  1221. this.getKeyMap();
  1222. }
  1223. if(this.draggable){
  1224. this.initDraggable();
  1225. }
  1226. if(this.toolbars.length &gt; 0){
  1227. Ext.each(this.toolbars, function(tb){
  1228. tb.doLayout();
  1229. tb.on({
  1230. scope: this,
  1231. afterlayout: this.syncHeight,
  1232. remove: this.syncHeight
  1233. });
  1234. }, this);
  1235. this.syncHeight();
  1236. }
  1237. },
  1238. <span id='Ext-Panel-method-initDraggable'> // private
  1239. </span> initDraggable : function(){
  1240. <span id='Ext-Panel-property-dd'> /**
  1241. </span> * &lt;p&gt;If this Panel is configured {@link #draggable}, this property will contain
  1242. * an instance of {@link Ext.dd.DragSource} which handles dragging the Panel.&lt;/p&gt;
  1243. * The developer must provide implementations of the abstract methods of {@link Ext.dd.DragSource}
  1244. * in order to supply behaviour for each stage of the drag/drop process. See {@link #draggable}.
  1245. * @type Ext.dd.DragSource
  1246. * @property dd
  1247. */
  1248. this.dd = new Ext.Panel.DD(this, Ext.isBoolean(this.draggable) ? null : this.draggable);
  1249. },
  1250. <span id='Ext-Panel-method-beforeEffect'> // private
  1251. </span> beforeEffect : function(anim){
  1252. if(this.floating){
  1253. this.el.beforeAction();
  1254. }
  1255. if(anim !== false){
  1256. this.el.addClass('x-panel-animated');
  1257. }
  1258. },
  1259. <span id='Ext-Panel-method-afterEffect'> // private
  1260. </span> afterEffect : function(anim){
  1261. this.syncShadow();
  1262. this.el.removeClass('x-panel-animated');
  1263. },
  1264. <span id='Ext-Panel-method-createEffect'> // private - wraps up an animation param with internal callbacks
  1265. </span> createEffect : function(a, cb, scope){
  1266. var o = {
  1267. scope:scope,
  1268. block:true
  1269. };
  1270. if(a === true){
  1271. o.callback = cb;
  1272. return o;
  1273. }else if(!a.callback){
  1274. o.callback = cb;
  1275. }else { // wrap it up
  1276. o.callback = function(){
  1277. cb.call(scope);
  1278. Ext.callback(a.callback, a.scope);
  1279. };
  1280. }
  1281. return Ext.applyIf(o, a);
  1282. },
  1283. <span id='Ext-Panel-method-collapse'> /**
  1284. </span> * Collapses the panel body so that it becomes hidden. Fires the {@link #beforecollapse} event which will
  1285. * cancel the collapse action if it returns false.
  1286. * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
  1287. * {@link #animCollapse} panel config)
  1288. * @return {Ext.Panel} this
  1289. */
  1290. collapse : function(animate){
  1291. if(this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforecollapse', this, animate) === false){
  1292. return;
  1293. }
  1294. var doAnim = animate === true || (animate !== false &amp;&amp; this.animCollapse);
  1295. this.beforeEffect(doAnim);
  1296. this.onCollapse(doAnim, animate);
  1297. return this;
  1298. },
  1299. <span id='Ext-Panel-method-onCollapse'> // private
  1300. </span> onCollapse : function(doAnim, animArg){
  1301. if(doAnim){
  1302. this[this.collapseEl].slideOut(this.slideAnchor,
  1303. Ext.apply(this.createEffect(animArg||true, this.afterCollapse, this),
  1304. this.collapseDefaults));
  1305. }else{
  1306. this[this.collapseEl].hide(this.hideMode);
  1307. this.afterCollapse(false);
  1308. }
  1309. },
  1310. <span id='Ext-Panel-method-afterCollapse'> // private
  1311. </span> afterCollapse : function(anim){
  1312. this.collapsed = true;
  1313. this.el.addClass(this.collapsedCls);
  1314. if(anim !== false){
  1315. this[this.collapseEl].hide(this.hideMode);
  1316. }
  1317. this.afterEffect(anim);
  1318. // Reset lastSize of all sub-components so they KNOW they are in a collapsed container
  1319. this.cascade(function(c) {
  1320. if (c.lastSize) {
  1321. c.lastSize = { width: undefined, height: undefined };
  1322. }
  1323. });
  1324. this.fireEvent('collapse', this);
  1325. },
  1326. <span id='Ext-Panel-method-expand'> /**
  1327. </span> * Expands the panel body so that it becomes visible. Fires the {@link #beforeexpand} event which will
  1328. * cancel the expand action if it returns false.
  1329. * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
  1330. * {@link #animCollapse} panel config)
  1331. * @return {Ext.Panel} this
  1332. */
  1333. expand : function(animate){
  1334. if(!this.collapsed || this.el.hasFxBlock() || this.fireEvent('beforeexpand', this, animate) === false){
  1335. return;
  1336. }
  1337. var doAnim = animate === true || (animate !== false &amp;&amp; this.animCollapse);
  1338. this.el.removeClass(this.collapsedCls);
  1339. this.beforeEffect(doAnim);
  1340. this.onExpand(doAnim, animate);
  1341. return this;
  1342. },
  1343. <span id='Ext-Panel-method-onExpand'> // private
  1344. </span> onExpand : function(doAnim, animArg){
  1345. if(doAnim){
  1346. this[this.collapseEl].slideIn(this.slideAnchor,
  1347. Ext.apply(this.createEffect(animArg||true, this.afterExpand, this),
  1348. this.expandDefaults));
  1349. }else{
  1350. this[this.collapseEl].show(this.hideMode);
  1351. this.afterExpand(false);
  1352. }
  1353. },
  1354. <span id='Ext-Panel-method-afterExpand'> // private
  1355. </span> afterExpand : function(anim){
  1356. this.collapsed = false;
  1357. if(anim !== false){
  1358. this[this.collapseEl].show(this.hideMode);
  1359. }
  1360. this.afterEffect(anim);
  1361. if (this.deferLayout) {
  1362. delete this.deferLayout;
  1363. this.doLayout(true);
  1364. }
  1365. this.fireEvent('expand', this);
  1366. },
  1367. <span id='Ext-Panel-method-toggleCollapse'> /**
  1368. </span> * Shortcut for performing an {@link #expand} or {@link #collapse} based on the current state of the panel.
  1369. * @param {Boolean} animate True to animate the transition, else false (defaults to the value of the
  1370. * {@link #animCollapse} panel config)
  1371. * @return {Ext.Panel} this
  1372. */
  1373. toggleCollapse : function(animate){
  1374. this[this.collapsed ? 'expand' : 'collapse'](animate);
  1375. return this;
  1376. },
  1377. <span id='Ext-Panel-method-onDisable'> // private
  1378. </span> onDisable : function(){
  1379. if(this.rendered &amp;&amp; this.maskDisabled){
  1380. this.el.mask();
  1381. }
  1382. Ext.Panel.superclass.onDisable.call(this);
  1383. },
  1384. <span id='Ext-Panel-method-onEnable'> // private
  1385. </span> onEnable : function(){
  1386. if(this.rendered &amp;&amp; this.maskDisabled){
  1387. this.el.unmask();
  1388. }
  1389. Ext.Panel.superclass.onEnable.call(this);
  1390. },
  1391. <span id='Ext-Panel-method-onResize'> // private
  1392. </span> onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
  1393. var w = adjWidth,
  1394. h = adjHeight;
  1395. if(Ext.isDefined(w) || Ext.isDefined(h)){
  1396. if(!this.collapsed){
  1397. // First, set the the Panel's body width.
  1398. // If we have auto-widthed it, get the resulting full offset width so we can size the Toolbars to match
  1399. // The Toolbars must not buffer this resize operation because we need to know their heights.
  1400. if(Ext.isNumber(w)){
  1401. this.body.setWidth(w = this.adjustBodyWidth(w - this.getFrameWidth()));
  1402. } else if (w == 'auto') {
  1403. w = this.body.setWidth('auto').dom.offsetWidth;
  1404. } else {
  1405. w = this.body.dom.offsetWidth;
  1406. }
  1407. if(this.tbar){
  1408. this.tbar.setWidth(w);
  1409. if(this.topToolbar){
  1410. this.topToolbar.setSize(w);
  1411. }
  1412. }
  1413. if(this.bbar){
  1414. this.bbar.setWidth(w);
  1415. if(this.bottomToolbar){
  1416. this.bottomToolbar.setSize(w);
  1417. // The bbar does not move on resize without this.
  1418. if (Ext.isIE9m) {
  1419. this.bbar.setStyle('position', 'static');
  1420. this.bbar.setStyle('position', '');
  1421. }
  1422. }
  1423. }
  1424. if(this.footer){
  1425. this.footer.setWidth(w);
  1426. if(this.fbar){
  1427. this.fbar.setSize(Ext.isIE9m ? (w - this.footer.getFrameWidth('lr')) : 'auto');
  1428. }
  1429. }
  1430. // At this point, the Toolbars must be layed out for getFrameHeight to find a result.
  1431. if(Ext.isNumber(h)){
  1432. h = Math.max(0, h - this.getFrameHeight());
  1433. //h = Math.max(0, h - (this.getHeight() - this.body.getHeight()));
  1434. this.body.setHeight(h);
  1435. }else if(h == 'auto'){
  1436. this.body.setHeight(h);
  1437. }
  1438. if(this.disabled &amp;&amp; this.el._mask){
  1439. this.el._mask.setSize(this.el.dom.clientWidth, this.el.getHeight());
  1440. }
  1441. }else{
  1442. // Adds an event to set the correct height afterExpand. This accounts for the deferHeight flag in panel
  1443. this.queuedBodySize = {width: w, height: h};
  1444. if(!this.queuedExpand &amp;&amp; this.allowQueuedExpand !== false){
  1445. this.queuedExpand = true;
  1446. this.on('expand', function(){
  1447. delete this.queuedExpand;
  1448. this.onResize(this.queuedBodySize.width, this.queuedBodySize.height);
  1449. }, this, {single:true});
  1450. }
  1451. }
  1452. this.onBodyResize(w, h);
  1453. }
  1454. this.syncShadow();
  1455. Ext.Panel.superclass.onResize.call(this, adjWidth, adjHeight, rawWidth, rawHeight);
  1456. },
  1457. <span id='Ext-Panel-method-onBodyResize'> // private
  1458. </span> onBodyResize: function(w, h){
  1459. this.fireEvent('bodyresize', this, w, h);
  1460. },
  1461. <span id='Ext-Panel-method-getToolbarHeight'> // private
  1462. </span> getToolbarHeight: function(){
  1463. var h = 0;
  1464. if(this.rendered){
  1465. Ext.each(this.toolbars, function(tb){
  1466. h += tb.getHeight();
  1467. }, this);
  1468. }
  1469. return h;
  1470. },
  1471. <span id='Ext-Panel-method-adjustBodyHeight'> // deprecate
  1472. </span> adjustBodyHeight : function(h){
  1473. return h;
  1474. },
  1475. <span id='Ext-Panel-method-adjustBodyWidth'> // private
  1476. </span> adjustBodyWidth : function(w){
  1477. return w;
  1478. },
  1479. <span id='Ext-Panel-method-onPosition'> // private
  1480. </span> onPosition : function(){
  1481. this.syncShadow();
  1482. },
  1483. <span id='Ext-Panel-method-getFrameWidth'> /**
  1484. </span> * Returns the width in pixels of the framing elements of this panel (not including the body width). To
  1485. * retrieve the body width see {@link #getInnerWidth}.
  1486. * @return {Number} The frame width
  1487. */
  1488. getFrameWidth : function(){
  1489. var w = this.el.getFrameWidth('lr') + this.bwrap.getFrameWidth('lr');
  1490. if(this.frame){
  1491. var l = this.bwrap.dom.firstChild;
  1492. w += (Ext.fly(l).getFrameWidth('l') + Ext.fly(l.firstChild).getFrameWidth('r'));
  1493. w += this.mc.getFrameWidth('lr');
  1494. }
  1495. return w;
  1496. },
  1497. <span id='Ext-Panel-method-getFrameHeight'> /**
  1498. </span> * Returns the height in pixels of the framing elements of this panel (including any top and bottom bars and
  1499. * header and footer elements, but not including the body height). To retrieve the body height see {@link #getInnerHeight}.
  1500. * @return {Number} The frame height
  1501. */
  1502. getFrameHeight : function() {
  1503. var h = this.el.getFrameWidth('tb') + this.bwrap.getFrameWidth('tb');
  1504. h += (this.tbar ? this.tbar.getHeight() : 0) +
  1505. (this.bbar ? this.bbar.getHeight() : 0);
  1506. if(this.frame){
  1507. h += this.el.dom.firstChild.offsetHeight + this.ft.dom.offsetHeight + this.mc.getFrameWidth('tb');
  1508. }else{
  1509. h += (this.header ? this.header.getHeight() : 0) +
  1510. (this.footer ? this.footer.getHeight() : 0);
  1511. }
  1512. return h;
  1513. },
  1514. <span id='Ext-Panel-method-getInnerWidth'> /**
  1515. </span> * Returns the width in pixels of the body element (not including the width of any framing elements).
  1516. * For the frame width see {@link #getFrameWidth}.
  1517. * @return {Number} The body width
  1518. */
  1519. getInnerWidth : function(){
  1520. return this.getSize().width - this.getFrameWidth();
  1521. },
  1522. <span id='Ext-Panel-method-getInnerHeight'> /**
  1523. </span> * Returns the height in pixels of the body element (not including the height of any framing elements).
  1524. * For the frame height see {@link #getFrameHeight}.
  1525. * @return {Number} The body height
  1526. */
  1527. getInnerHeight : function(){
  1528. return this.body.getHeight();
  1529. /* Deprecate
  1530. return this.getSize().height - this.getFrameHeight();
  1531. */
  1532. },
  1533. <span id='Ext-Panel-method-syncShadow'> // private
  1534. </span> syncShadow : function(){
  1535. if(this.floating){
  1536. this.el.sync(true);
  1537. }
  1538. },
  1539. <span id='Ext-Panel-method-getLayoutTarget'> // private
  1540. </span> getLayoutTarget : function(){
  1541. return this.body;
  1542. },
  1543. <span id='Ext-Panel-method-getContentTarget'> // private
  1544. </span> getContentTarget : function(){
  1545. return this.body;
  1546. },
  1547. <span id='Ext-Panel-method-setTitle'> /**
  1548. </span> * &lt;p&gt;Sets the title text for the panel and optionally the {@link #iconCls icon class}.&lt;/p&gt;
  1549. * &lt;p&gt;In order to be able to set the title, a header element must have been created
  1550. * for the Panel. This is triggered either by configuring the Panel with a non-blank &lt;code&gt;{@link #title}&lt;/code&gt;,
  1551. * or configuring it with &lt;code&gt;&lt;b&gt;{@link #header}: true&lt;/b&gt;&lt;/code&gt;.&lt;/p&gt;
  1552. * @param {String} title The title text to set
  1553. * @param {String} iconCls (optional) {@link #iconCls iconCls} A user-defined CSS class that provides the icon image for this panel
  1554. */
  1555. setTitle : function(title, iconCls){
  1556. this.title = title;
  1557. if(this.header &amp;&amp; this.headerAsText){
  1558. this.header.child('span').update(title);
  1559. }
  1560. if(iconCls){
  1561. this.setIconClass(iconCls);
  1562. }
  1563. this.fireEvent('titlechange', this, title);
  1564. return this;
  1565. },
  1566. <span id='Ext-Panel-method-getUpdater'> /**
  1567. </span> * Get the {@link Ext.Updater} for this panel. Enables you to perform Ajax updates of this panel's body.
  1568. * @return {Ext.Updater} The Updater
  1569. */
  1570. getUpdater : function(){
  1571. return this.body.getUpdater();
  1572. },
  1573. <span id='Ext-Panel-method-load'> /**
  1574. </span> * Loads this content panel immediately with content returned from an XHR call.
  1575. * @param {Object/String/Function} config A config object containing any of the following options:
  1576. &lt;pre&gt;&lt;code&gt;
  1577. panel.load({
  1578. url: 'your-url.php',
  1579. params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string
  1580. callback: yourFunction,
  1581. scope: yourObject, // optional scope for the callback
  1582. discardUrl: false,
  1583. nocache: false,
  1584. text: 'Loading...',
  1585. timeout: 30,
  1586. scripts: false
  1587. });
  1588. &lt;/code&gt;&lt;/pre&gt;
  1589. * The only required property is url. The optional properties nocache, text and scripts
  1590. * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their
  1591. * associated property on this panel Updater instance.
  1592. * @return {Ext.Panel} this
  1593. */
  1594. load : function(){
  1595. var um = this.body.getUpdater();
  1596. um.update.apply(um, arguments);
  1597. return this;
  1598. },
  1599. <span id='Ext-Panel-method-beforeDestroy'> // private
  1600. </span> beforeDestroy : function(){
  1601. Ext.Panel.superclass.beforeDestroy.call(this);
  1602. if(this.header){
  1603. this.header.removeAllListeners();
  1604. }
  1605. if(this.tools){
  1606. for(var k in this.tools){
  1607. Ext.destroy(this.tools[k]);
  1608. }
  1609. }
  1610. if(this.toolbars.length &gt; 0){
  1611. Ext.each(this.toolbars, function(tb){
  1612. tb.un('afterlayout', this.syncHeight, this);
  1613. tb.un('remove', this.syncHeight, this);
  1614. }, this);
  1615. }
  1616. if(Ext.isArray(this.buttons)){
  1617. while(this.buttons.length) {
  1618. Ext.destroy(this.buttons[0]);
  1619. }
  1620. }
  1621. if(this.rendered){
  1622. Ext.destroy(
  1623. this.ft,
  1624. this.header,
  1625. this.footer,
  1626. this.tbar,
  1627. this.bbar,
  1628. this.body,
  1629. this.mc,
  1630. this.bwrap,
  1631. this.dd
  1632. );
  1633. if (this.fbar) {
  1634. Ext.destroy(
  1635. this.fbar,
  1636. this.fbar.el
  1637. );
  1638. }
  1639. }
  1640. Ext.destroy(this.toolbars);
  1641. },
  1642. <span id='Ext-Panel-method-createClasses'> // private
  1643. </span> createClasses : function(){
  1644. this.headerCls = this.baseCls + '-header';
  1645. this.headerTextCls = this.baseCls + '-header-text';
  1646. this.bwrapCls = this.baseCls + '-bwrap';
  1647. this.tbarCls = this.baseCls + '-tbar';
  1648. this.bodyCls = this.baseCls + '-body';
  1649. this.bbarCls = this.baseCls + '-bbar';
  1650. this.footerCls = this.baseCls + '-footer';
  1651. },
  1652. <span id='Ext-Panel-method-createGhost'> // private
  1653. </span> createGhost : function(cls, useShim, appendTo){
  1654. var el = document.createElement('div');
  1655. el.className = 'x-panel-ghost ' + (cls ? cls : '');
  1656. if(this.header){
  1657. el.appendChild(this.el.dom.firstChild.cloneNode(true));
  1658. }
  1659. Ext.fly(el.appendChild(document.createElement('ul'))).setHeight(this.bwrap.getHeight());
  1660. el.style.width = this.el.dom.offsetWidth + 'px';;
  1661. if(!appendTo){
  1662. this.container.dom.appendChild(el);
  1663. }else{
  1664. Ext.getDom(appendTo).appendChild(el);
  1665. }
  1666. if(useShim !== false &amp;&amp; this.el.useShim !== false){
  1667. var layer = new Ext.Layer({shadow:false, useDisplay:true, constrain:false}, el);
  1668. layer.show();
  1669. return layer;
  1670. }else{
  1671. return new Ext.Element(el);
  1672. }
  1673. },
  1674. <span id='Ext-Panel-method-doAutoLoad'> // private
  1675. </span> doAutoLoad : function(){
  1676. var u = this.body.getUpdater();
  1677. if(this.renderer){
  1678. u.setRenderer(this.renderer);
  1679. }
  1680. u.update(Ext.isObject(this.autoLoad) ? this.autoLoad : {url: this.autoLoad});
  1681. },
  1682. <span id='Ext-Panel-method-getTool'> /**
  1683. </span> * Retrieve a tool by id.
  1684. * @param {String} id
  1685. * @return {Object} tool
  1686. */
  1687. getTool : function(id) {
  1688. return this.tools[id];
  1689. }
  1690. <span id='Ext-Panel-cfg-autoEl'>/**
  1691. </span> * @cfg {String} autoEl @hide
  1692. */
  1693. });
  1694. Ext.reg('panel', Ext.Panel);
  1695. </pre>
  1696. </body>
  1697. </html>