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.

1816 lines
80 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-Component-method-constructor'><span id='Ext-Component'>/**
  19. </span></span> * @class Ext.Component
  20. * @extends Ext.util.Observable
  21. * &lt;p&gt;Base class for all Ext components. All subclasses of Component may participate in the automated
  22. * Ext component lifecycle of creation, rendering and destruction which is provided by the {@link Ext.Container Container} class.
  23. * Components may be added to a Container through the {@link Ext.Container#items items} config option at the time the Container is created,
  24. * or they may be added dynamically via the {@link Ext.Container#add add} method.&lt;/p&gt;
  25. * &lt;p&gt;The Component base class has built-in support for basic hide/show and enable/disable behavior.&lt;/p&gt;
  26. * &lt;p&gt;All Components are registered with the {@link Ext.ComponentMgr} on construction so that they can be referenced at any time via
  27. * {@link Ext#getCmp}, passing the {@link #id}.&lt;/p&gt;
  28. * &lt;p&gt;All user-developed visual widgets that are required to participate in automated lifecycle and size management should subclass Component (or
  29. * {@link Ext.BoxComponent} if managed box model handling is required, ie height and width management).&lt;/p&gt;
  30. * &lt;p&gt;See the &lt;a href=&quot;http://extjs.com/learn/Tutorial:Creating_new_UI_controls&quot;&gt;Creating new UI controls&lt;/a&gt; tutorial for details on how
  31. * and to either extend or augment ExtJs base classes to create custom Components.&lt;/p&gt;
  32. * &lt;p&gt;Every component has a specific xtype, which is its Ext-specific type name, along with methods for checking the
  33. * xtype like {@link #getXType} and {@link #isXType}. This is the list of all valid xtypes:&lt;/p&gt;
  34. * &lt;pre&gt;
  35. xtype Class
  36. ------------- ------------------
  37. box {@link Ext.BoxComponent}
  38. button {@link Ext.Button}
  39. buttongroup {@link Ext.ButtonGroup}
  40. colorpalette {@link Ext.ColorPalette}
  41. component {@link Ext.Component}
  42. container {@link Ext.Container}
  43. cycle {@link Ext.CycleButton}
  44. dataview {@link Ext.DataView}
  45. datepicker {@link Ext.DatePicker}
  46. editor {@link Ext.Editor}
  47. editorgrid {@link Ext.grid.EditorGridPanel}
  48. flash {@link Ext.FlashComponent}
  49. grid {@link Ext.grid.GridPanel}
  50. listview {@link Ext.ListView}
  51. multislider {@link Ext.slider.MultiSlider}
  52. panel {@link Ext.Panel}
  53. progress {@link Ext.ProgressBar}
  54. propertygrid {@link Ext.grid.PropertyGrid}
  55. slider {@link Ext.slider.SingleSlider}
  56. spacer {@link Ext.Spacer}
  57. splitbutton {@link Ext.SplitButton}
  58. tabpanel {@link Ext.TabPanel}
  59. treepanel {@link Ext.tree.TreePanel}
  60. viewport {@link Ext.ViewPort}
  61. window {@link Ext.Window}
  62. Toolbar components
  63. ---------------------------------------
  64. paging {@link Ext.PagingToolbar}
  65. toolbar {@link Ext.Toolbar}
  66. tbbutton {@link Ext.Toolbar.Button} (deprecated; use button)
  67. tbfill {@link Ext.Toolbar.Fill}
  68. tbitem {@link Ext.Toolbar.Item}
  69. tbseparator {@link Ext.Toolbar.Separator}
  70. tbspacer {@link Ext.Toolbar.Spacer}
  71. tbsplit {@link Ext.Toolbar.SplitButton} (deprecated; use splitbutton)
  72. tbtext {@link Ext.Toolbar.TextItem}
  73. Menu components
  74. ---------------------------------------
  75. menu {@link Ext.menu.Menu}
  76. colormenu {@link Ext.menu.ColorMenu}
  77. datemenu {@link Ext.menu.DateMenu}
  78. menubaseitem {@link Ext.menu.BaseItem}
  79. menucheckitem {@link Ext.menu.CheckItem}
  80. menuitem {@link Ext.menu.Item}
  81. menuseparator {@link Ext.menu.Separator}
  82. menutextitem {@link Ext.menu.TextItem}
  83. Form components
  84. ---------------------------------------
  85. form {@link Ext.form.FormPanel}
  86. checkbox {@link Ext.form.Checkbox}
  87. checkboxgroup {@link Ext.form.CheckboxGroup}
  88. combo {@link Ext.form.ComboBox}
  89. compositefield {@link Ext.form.CompositeField}
  90. datefield {@link Ext.form.DateField}
  91. displayfield {@link Ext.form.DisplayField}
  92. field {@link Ext.form.Field}
  93. fieldset {@link Ext.form.FieldSet}
  94. hidden {@link Ext.form.Hidden}
  95. htmleditor {@link Ext.form.HtmlEditor}
  96. label {@link Ext.form.Label}
  97. numberfield {@link Ext.form.NumberField}
  98. radio {@link Ext.form.Radio}
  99. radiogroup {@link Ext.form.RadioGroup}
  100. textarea {@link Ext.form.TextArea}
  101. textfield {@link Ext.form.TextField}
  102. timefield {@link Ext.form.TimeField}
  103. trigger {@link Ext.form.TriggerField}
  104. twintrigger {@link Ext.form.TwinTriggerField}
  105. Chart components
  106. ---------------------------------------
  107. chart {@link Ext.chart.Chart}
  108. barchart {@link Ext.chart.BarChart}
  109. cartesianchart {@link Ext.chart.CartesianChart}
  110. columnchart {@link Ext.chart.ColumnChart}
  111. linechart {@link Ext.chart.LineChart}
  112. piechart {@link Ext.chart.PieChart}
  113. Store xtypes
  114. ---------------------------------------
  115. arraystore {@link Ext.data.ArrayStore}
  116. directstore {@link Ext.data.DirectStore}
  117. groupingstore {@link Ext.data.GroupingStore}
  118. jsonstore {@link Ext.data.JsonStore}
  119. simplestore {@link Ext.data.SimpleStore} (deprecated; use arraystore)
  120. store {@link Ext.data.Store}
  121. xmlstore {@link Ext.data.XmlStore}
  122. &lt;/pre&gt;
  123. * @constructor
  124. * @param {Ext.Element/String/Object} config The configuration options may be specified as either:
  125. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  126. * &lt;li&gt;&lt;b&gt;an element&lt;/b&gt; :
  127. * &lt;p class=&quot;sub-desc&quot;&gt;it is set as the internal element and its id used as the component id&lt;/p&gt;&lt;/li&gt;
  128. * &lt;li&gt;&lt;b&gt;a string&lt;/b&gt; :
  129. * &lt;p class=&quot;sub-desc&quot;&gt;it is assumed to be the id of an existing element and is used as the component id&lt;/p&gt;&lt;/li&gt;
  130. * &lt;li&gt;&lt;b&gt;anything else&lt;/b&gt; :
  131. * &lt;p class=&quot;sub-desc&quot;&gt;it is assumed to be a standard config object and is applied to the component&lt;/p&gt;&lt;/li&gt;
  132. * &lt;/ul&gt;&lt;/div&gt;
  133. */
  134. Ext.Component = function(config){
  135. config = config || {};
  136. if(config.initialConfig){
  137. if(config.isAction){ // actions
  138. this.baseAction = config;
  139. }
  140. config = config.initialConfig; // component cloning / action set up
  141. }else if(config.tagName || config.dom || Ext.isString(config)){ // element object
  142. config = {applyTo: config, id: config.id || config};
  143. }
  144. <span id='Ext-Component-property-initialConfig'> /**
  145. </span> * This Component's initial configuration specification. Read-only.
  146. * @type Object
  147. * @property initialConfig
  148. */
  149. this.initialConfig = config;
  150. Ext.apply(this, config);
  151. this.addEvents(
  152. <span id='Ext-Component-event-added'> /**
  153. </span> * @event added
  154. * Fires when a component is added to an Ext.Container
  155. * @param {Ext.Component} this
  156. * @param {Ext.Container} ownerCt Container which holds the component
  157. * @param {number} index Position at which the component was added
  158. */
  159. 'added',
  160. <span id='Ext-Component-event-disable'> /**
  161. </span> * @event disable
  162. * Fires after the component is disabled.
  163. * @param {Ext.Component} this
  164. */
  165. 'disable',
  166. <span id='Ext-Component-event-enable'> /**
  167. </span> * @event enable
  168. * Fires after the component is enabled.
  169. * @param {Ext.Component} this
  170. */
  171. 'enable',
  172. <span id='Ext-Component-event-beforeshow'> /**
  173. </span> * @event beforeshow
  174. * Fires before the component is shown by calling the {@link #show} method.
  175. * Return false from an event handler to stop the show.
  176. * @param {Ext.Component} this
  177. */
  178. 'beforeshow',
  179. <span id='Ext-Component-event-show'> /**
  180. </span> * @event show
  181. * Fires after the component is shown when calling the {@link #show} method.
  182. * @param {Ext.Component} this
  183. */
  184. 'show',
  185. <span id='Ext-Component-event-beforehide'> /**
  186. </span> * @event beforehide
  187. * Fires before the component is hidden by calling the {@link #hide} method.
  188. * Return false from an event handler to stop the hide.
  189. * @param {Ext.Component} this
  190. */
  191. 'beforehide',
  192. <span id='Ext-Component-event-hide'> /**
  193. </span> * @event hide
  194. * Fires after the component is hidden.
  195. * Fires after the component is hidden when calling the {@link #hide} method.
  196. * @param {Ext.Component} this
  197. */
  198. 'hide',
  199. <span id='Ext-Component-event-removed'> /**
  200. </span> * @event removed
  201. * Fires when a component is removed from an Ext.Container
  202. * @param {Ext.Component} this
  203. * @param {Ext.Container} ownerCt Container which holds the component
  204. */
  205. 'removed',
  206. <span id='Ext-Component-event-beforerender'> /**
  207. </span> * @event beforerender
  208. * Fires before the component is {@link #rendered}. Return false from an
  209. * event handler to stop the {@link #render}.
  210. * @param {Ext.Component} this
  211. */
  212. 'beforerender',
  213. <span id='Ext-Component-event-render'> /**
  214. </span> * @event render
  215. * Fires after the component markup is {@link #rendered}.
  216. * @param {Ext.Component} this
  217. */
  218. 'render',
  219. <span id='Ext-Component-event-afterrender'> /**
  220. </span> * @event afterrender
  221. * &lt;p&gt;Fires after the component rendering is finished.&lt;/p&gt;
  222. * &lt;p&gt;The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed
  223. * by any afterRender method defined for the Component, and, if {@link #stateful}, after state
  224. * has been restored.&lt;/p&gt;
  225. * @param {Ext.Component} this
  226. */
  227. 'afterrender',
  228. <span id='Ext-Component-event-beforedestroy'> /**
  229. </span> * @event beforedestroy
  230. * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}.
  231. * @param {Ext.Component} this
  232. */
  233. 'beforedestroy',
  234. <span id='Ext-Component-event-destroy'> /**
  235. </span> * @event destroy
  236. * Fires after the component is {@link #destroy}ed.
  237. * @param {Ext.Component} this
  238. */
  239. 'destroy',
  240. <span id='Ext-Component-event-beforestaterestore'> /**
  241. </span> * @event beforestaterestore
  242. * Fires before the state of the component is restored. Return false from an event handler to stop the restore.
  243. * @param {Ext.Component} this
  244. * @param {Object} state The hash of state values returned from the StateProvider. If this
  245. * event is not vetoed, then the state object is passed to &lt;b&gt;&lt;tt&gt;applyState&lt;/tt&gt;&lt;/b&gt;. By default,
  246. * that simply copies property values into this Component. The method maybe overriden to
  247. * provide custom state restoration.
  248. */
  249. 'beforestaterestore',
  250. <span id='Ext-Component-event-staterestore'> /**
  251. </span> * @event staterestore
  252. * Fires after the state of the component is restored.
  253. * @param {Ext.Component} this
  254. * @param {Object} state The hash of state values returned from the StateProvider. This is passed
  255. * to &lt;b&gt;&lt;tt&gt;applyState&lt;/tt&gt;&lt;/b&gt;. By default, that simply copies property values into this
  256. * Component. The method maybe overriden to provide custom state restoration.
  257. */
  258. 'staterestore',
  259. <span id='Ext-Component-event-beforestatesave'> /**
  260. </span> * @event beforestatesave
  261. * Fires before the state of the component is saved to the configured state provider. Return false to stop the save.
  262. * @param {Ext.Component} this
  263. * @param {Object} state The hash of state values. This is determined by calling
  264. * &lt;b&gt;&lt;tt&gt;getState()&lt;/tt&gt;&lt;/b&gt; on the Component. This method must be provided by the
  265. * developer to return whetever representation of state is required, by default, Ext.Component
  266. * has a null implementation.
  267. */
  268. 'beforestatesave',
  269. <span id='Ext-Component-event-statesave'> /**
  270. </span> * @event statesave
  271. * Fires after the state of the component is saved to the configured state provider.
  272. * @param {Ext.Component} this
  273. * @param {Object} state The hash of state values. This is determined by calling
  274. * &lt;b&gt;&lt;tt&gt;getState()&lt;/tt&gt;&lt;/b&gt; on the Component. This method must be provided by the
  275. * developer to return whetever representation of state is required, by default, Ext.Component
  276. * has a null implementation.
  277. */
  278. 'statesave'
  279. );
  280. this.getId();
  281. Ext.ComponentMgr.register(this);
  282. Ext.Component.superclass.constructor.call(this);
  283. if(this.baseAction){
  284. this.baseAction.addComponent(this);
  285. }
  286. this.initComponent();
  287. if(this.plugins){
  288. if(Ext.isArray(this.plugins)){
  289. for(var i = 0, len = this.plugins.length; i &lt; len; i++){
  290. this.plugins[i] = this.initPlugin(this.plugins[i]);
  291. }
  292. }else{
  293. this.plugins = this.initPlugin(this.plugins);
  294. }
  295. }
  296. if(this.stateful !== false){
  297. this.initState();
  298. }
  299. if(this.applyTo){
  300. this.applyToMarkup(this.applyTo);
  301. delete this.applyTo;
  302. }else if(this.renderTo){
  303. this.render(this.renderTo);
  304. delete this.renderTo;
  305. }
  306. };
  307. // private
  308. Ext.Component.AUTO_ID = 1000;
  309. Ext.extend(Ext.Component, Ext.util.Observable, {
  310. // Configs below are used for all Components when rendered by FormLayout.
  311. <span id='Ext-Component-cfg-fieldLabel'> /**
  312. </span> * @cfg {String} fieldLabel &lt;p&gt;The label text to display next to this Component (defaults to '').&lt;/p&gt;
  313. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this Component is rendered by a Container which
  314. * has been configured to use the &lt;b&gt;{@link Ext.layout.FormLayout FormLayout}&lt;/b&gt; layout manager (e.g.
  315. * {@link Ext.form.FormPanel} or specifying &lt;tt&gt;layout:'form'&lt;/tt&gt;).&lt;/p&gt;&lt;br&gt;
  316. * &lt;p&gt;Also see &lt;tt&gt;{@link #hideLabel}&lt;/tt&gt; and
  317. * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.&lt;/p&gt;
  318. * Example use:&lt;pre&gt;&lt;code&gt;
  319. new Ext.FormPanel({
  320. height: 100,
  321. renderTo: Ext.getBody(),
  322. items: [{
  323. xtype: 'textfield',
  324. fieldLabel: 'Name'
  325. }]
  326. });
  327. &lt;/code&gt;&lt;/pre&gt;
  328. */
  329. <span id='Ext-Component-cfg-labelStyle'> /**
  330. </span> * @cfg {String} labelStyle &lt;p&gt;A CSS style specification string to apply directly to this field's
  331. * label. Defaults to the container's labelStyle value if set (e.g.,
  332. * &lt;tt&gt;{@link Ext.layout.FormLayout#labelStyle}&lt;/tt&gt; , or '').&lt;/p&gt;
  333. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the note for &lt;code&gt;{@link #clearCls}&lt;/code&gt;.&lt;/p&gt;&lt;br&gt;
  334. * &lt;p&gt;Also see &lt;code&gt;{@link #hideLabel}&lt;/code&gt; and
  335. * &lt;code&gt;{@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.&lt;/code&gt;&lt;/p&gt;
  336. * Example use:&lt;pre&gt;&lt;code&gt;
  337. new Ext.FormPanel({
  338. height: 100,
  339. renderTo: Ext.getBody(),
  340. items: [{
  341. xtype: 'textfield',
  342. fieldLabel: 'Name',
  343. labelStyle: 'font-weight:bold;'
  344. }]
  345. });
  346. &lt;/code&gt;&lt;/pre&gt;
  347. */
  348. <span id='Ext-Component-cfg-labelSeparator'> /**
  349. </span> * @cfg {String} labelSeparator &lt;p&gt;The separator to display after the text of each
  350. * &lt;tt&gt;{@link #fieldLabel}&lt;/tt&gt;. This property may be configured at various levels.
  351. * The order of precedence is:
  352. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  353. * &lt;li&gt;field / component level&lt;/li&gt;
  354. * &lt;li&gt;container level&lt;/li&gt;
  355. * &lt;li&gt;{@link Ext.layout.FormLayout#labelSeparator layout level} (defaults to colon &lt;tt&gt;':'&lt;/tt&gt;)&lt;/li&gt;
  356. * &lt;/ul&gt;&lt;/div&gt;
  357. * To display no separator for this field's label specify empty string ''.&lt;/p&gt;
  358. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the note for &lt;tt&gt;{@link #clearCls}&lt;/tt&gt;.&lt;/p&gt;&lt;br&gt;
  359. * &lt;p&gt;Also see &lt;tt&gt;{@link #hideLabel}&lt;/tt&gt; and
  360. * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}.&lt;/p&gt;
  361. * Example use:&lt;pre&gt;&lt;code&gt;
  362. new Ext.FormPanel({
  363. height: 100,
  364. renderTo: Ext.getBody(),
  365. layoutConfig: {
  366. labelSeparator: '~' // layout config has lowest priority (defaults to ':')
  367. },
  368. {@link Ext.layout.FormLayout#labelSeparator labelSeparator}: '&gt;&gt;', // config at container level
  369. items: [{
  370. xtype: 'textfield',
  371. fieldLabel: 'Field 1',
  372. labelSeparator: '...' // field/component level config supersedes others
  373. },{
  374. xtype: 'textfield',
  375. fieldLabel: 'Field 2' // labelSeparator will be '='
  376. }]
  377. });
  378. &lt;/code&gt;&lt;/pre&gt;
  379. */
  380. <span id='Ext-Component-cfg-hideLabel'> /**
  381. </span> * @cfg {Boolean} hideLabel &lt;p&gt;&lt;tt&gt;true&lt;/tt&gt; to completely hide the label element
  382. * ({@link #fieldLabel label} and {@link #labelSeparator separator}). Defaults to &lt;tt&gt;false&lt;/tt&gt;.
  383. * By default, even if you do not specify a &lt;tt&gt;{@link #fieldLabel}&lt;/tt&gt; the space will still be
  384. * reserved so that the field will line up with other fields that do have labels.
  385. * Setting this to &lt;tt&gt;true&lt;/tt&gt; will cause the field to not reserve that space.&lt;/p&gt;
  386. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the note for &lt;tt&gt;{@link #clearCls}&lt;/tt&gt;.&lt;/p&gt;&lt;br&gt;
  387. * Example use:&lt;pre&gt;&lt;code&gt;
  388. new Ext.FormPanel({
  389. height: 100,
  390. renderTo: Ext.getBody(),
  391. items: [{
  392. xtype: 'textfield'
  393. hideLabel: true
  394. }]
  395. });
  396. &lt;/code&gt;&lt;/pre&gt;
  397. */
  398. <span id='Ext-Component-cfg-clearCls'> /**
  399. </span> * @cfg {String} clearCls &lt;p&gt;The CSS class used to to apply to the special clearing div rendered
  400. * directly after each form field wrapper to provide field clearing (defaults to
  401. * &lt;tt&gt;'x-form-clear-left'&lt;/tt&gt;).&lt;/p&gt;
  402. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this Component is rendered by a Container
  403. * which has been configured to use the &lt;b&gt;{@link Ext.layout.FormLayout FormLayout}&lt;/b&gt; layout
  404. * manager (e.g. {@link Ext.form.FormPanel} or specifying &lt;tt&gt;layout:'form'&lt;/tt&gt;) and either a
  405. * &lt;tt&gt;{@link #fieldLabel}&lt;/tt&gt; is specified or &lt;tt&gt;isFormField=true&lt;/tt&gt; is specified.&lt;/p&gt;&lt;br&gt;
  406. * &lt;p&gt;See {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl} also.&lt;/p&gt;
  407. */
  408. <span id='Ext-Component-cfg-itemCls'> /**
  409. </span> * @cfg {String} itemCls
  410. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this config is only used when this Component is rendered by a Container which
  411. * has been configured to use the &lt;b&gt;{@link Ext.layout.FormLayout FormLayout}&lt;/b&gt; layout manager (e.g.
  412. * {@link Ext.form.FormPanel} or specifying &lt;tt&gt;layout:'form'&lt;/tt&gt;).&lt;/p&gt;&lt;br&gt;
  413. * &lt;p&gt;An additional CSS class to apply to the div wrapping the form item
  414. * element of this field. If supplied, &lt;tt&gt;itemCls&lt;/tt&gt; at the &lt;b&gt;field&lt;/b&gt; level will override
  415. * the default &lt;tt&gt;itemCls&lt;/tt&gt; supplied at the &lt;b&gt;container&lt;/b&gt; level. The value specified for
  416. * &lt;tt&gt;itemCls&lt;/tt&gt; will be added to the default class (&lt;tt&gt;'x-form-item'&lt;/tt&gt;).&lt;/p&gt;
  417. * &lt;p&gt;Since it is applied to the item wrapper (see
  418. * {@link Ext.layout.FormLayout}.{@link Ext.layout.FormLayout#fieldTpl fieldTpl}), it allows
  419. * you to write standard CSS rules that can apply to the field, the label (if specified), or
  420. * any other element within the markup for the field.&lt;/p&gt;
  421. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: see the note for &lt;tt&gt;{@link #fieldLabel}&lt;/tt&gt;.&lt;/p&gt;&lt;br&gt;
  422. * Example use:&lt;pre&gt;&lt;code&gt;
  423. // Apply a style to the field&amp;#39;s label:
  424. &amp;lt;style&gt;
  425. .required .x-form-item-label {font-weight:bold;color:red;}
  426. &amp;lt;/style&gt;
  427. new Ext.FormPanel({
  428. height: 100,
  429. renderTo: Ext.getBody(),
  430. items: [{
  431. xtype: 'textfield',
  432. fieldLabel: 'Name',
  433. itemCls: 'required' //this label will be styled
  434. },{
  435. xtype: 'textfield',
  436. fieldLabel: 'Favorite Color'
  437. }]
  438. });
  439. &lt;/code&gt;&lt;/pre&gt;
  440. */
  441. <span id='Ext-Component-cfg-id'> /**
  442. </span> * @cfg {String} id
  443. * &lt;p&gt;The &lt;b&gt;unique&lt;/b&gt; id of this component (defaults to an {@link #getId auto-assigned id}).
  444. * You should assign an id if you need to be able to access the component later and you do
  445. * not have an object reference available (e.g., using {@link Ext}.{@link Ext#getCmp getCmp}).&lt;/p&gt;
  446. * &lt;p&gt;Note that this id will also be used as the element id for the containing HTML element
  447. * that is rendered to the page for this component. This allows you to write id-based CSS
  448. * rules to style the specific instance of this component uniquely, and also to select
  449. * sub-elements using this component's id as the parent.&lt;/p&gt;
  450. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: to avoid complications imposed by a unique &lt;tt&gt;id&lt;/tt&gt; also see
  451. * &lt;code&gt;{@link #itemId}&lt;/code&gt; and &lt;code&gt;{@link #ref}&lt;/code&gt;.&lt;/p&gt;
  452. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: to access the container of an item see &lt;code&gt;{@link #ownerCt}&lt;/code&gt;.&lt;/p&gt;
  453. */
  454. <span id='Ext-Component-cfg-itemId'> /**
  455. </span> * @cfg {String} itemId
  456. * &lt;p&gt;An &lt;tt&gt;itemId&lt;/tt&gt; can be used as an alternative way to get a reference to a component
  457. * when no object reference is available. Instead of using an &lt;code&gt;{@link #id}&lt;/code&gt; with
  458. * {@link Ext}.{@link Ext#getCmp getCmp}, use &lt;code&gt;itemId&lt;/code&gt; with
  459. * {@link Ext.Container}.{@link Ext.Container#getComponent getComponent} which will retrieve
  460. * &lt;code&gt;itemId&lt;/code&gt;'s or &lt;tt&gt;{@link #id}&lt;/tt&gt;'s. Since &lt;code&gt;itemId&lt;/code&gt;'s are an index to the
  461. * container's internal MixedCollection, the &lt;code&gt;itemId&lt;/code&gt; is scoped locally to the container --
  462. * avoiding potential conflicts with {@link Ext.ComponentMgr} which requires a &lt;b&gt;unique&lt;/b&gt;
  463. * &lt;code&gt;{@link #id}&lt;/code&gt;.&lt;/p&gt;
  464. * &lt;pre&gt;&lt;code&gt;
  465. var c = new Ext.Panel({ //
  466. {@link Ext.BoxComponent#height height}: 300,
  467. {@link #renderTo}: document.body,
  468. {@link Ext.Container#layout layout}: 'auto',
  469. {@link Ext.Container#items items}: [
  470. {
  471. itemId: 'p1',
  472. {@link Ext.Panel#title title}: 'Panel 1',
  473. {@link Ext.BoxComponent#height height}: 150
  474. },
  475. {
  476. itemId: 'p2',
  477. {@link Ext.Panel#title title}: 'Panel 2',
  478. {@link Ext.BoxComponent#height height}: 150
  479. }
  480. ]
  481. })
  482. p1 = c.{@link Ext.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
  483. p2 = p1.{@link #ownerCt}.{@link Ext.Container#getComponent getComponent}('p2'); // reference via a sibling
  484. * &lt;/code&gt;&lt;/pre&gt;
  485. * &lt;p&gt;Also see &lt;tt&gt;{@link #id}&lt;/tt&gt; and &lt;code&gt;{@link #ref}&lt;/code&gt;.&lt;/p&gt;
  486. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: to access the container of an item see &lt;tt&gt;{@link #ownerCt}&lt;/tt&gt;.&lt;/p&gt;
  487. */
  488. <span id='Ext-Component-cfg-xtype'> /**
  489. </span> * @cfg {String} xtype
  490. * The registered &lt;tt&gt;xtype&lt;/tt&gt; to create. This config option is not used when passing
  491. * a config object into a constructor. This config option is used only when
  492. * lazy instantiation is being used, and a child item of a Container is being
  493. * specified not as a fully instantiated Component, but as a &lt;i&gt;Component config
  494. * object&lt;/i&gt;. The &lt;tt&gt;xtype&lt;/tt&gt; will be looked up at render time up to determine what
  495. * type of child Component to create.&lt;br&gt;&lt;br&gt;
  496. * The predefined xtypes are listed {@link Ext.Component here}.
  497. * &lt;br&gt;&lt;br&gt;
  498. * If you subclass Components to create your own Components, you may register
  499. * them using {@link Ext.ComponentMgr#registerType} in order to be able to
  500. * take advantage of lazy instantiation and rendering.
  501. */
  502. <span id='Ext-Component-cfg-ptype'> /**
  503. </span> * @cfg {String} ptype
  504. * The registered &lt;tt&gt;ptype&lt;/tt&gt; to create. This config option is not used when passing
  505. * a config object into a constructor. This config option is used only when
  506. * lazy instantiation is being used, and a Plugin is being
  507. * specified not as a fully instantiated Component, but as a &lt;i&gt;Component config
  508. * object&lt;/i&gt;. The &lt;tt&gt;ptype&lt;/tt&gt; will be looked up at render time up to determine what
  509. * type of Plugin to create.&lt;br&gt;&lt;br&gt;
  510. * If you create your own Plugins, you may register them using
  511. * {@link Ext.ComponentMgr#registerPlugin} in order to be able to
  512. * take advantage of lazy instantiation and rendering.
  513. */
  514. <span id='Ext-Component-cfg-cls'> /**
  515. </span> * @cfg {String} cls
  516. * An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be
  517. * useful for adding customized styles to the component or any of its children using standard CSS rules.
  518. */
  519. <span id='Ext-Component-cfg-overCls'> /**
  520. </span> * @cfg {String} overCls
  521. * An optional extra CSS class that will be added to this component's Element when the mouse moves
  522. * over the Element, and removed when the mouse moves out. (defaults to ''). This can be
  523. * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
  524. */
  525. <span id='Ext-Component-cfg-style'> /**
  526. </span> * @cfg {String} style
  527. * A custom style specification to be applied to this component's Element. Should be a valid argument to
  528. * {@link Ext.Element#applyStyles}.
  529. * &lt;pre&gt;&lt;code&gt;
  530. new Ext.Panel({
  531. title: 'Some Title',
  532. renderTo: Ext.getBody(),
  533. width: 400, height: 300,
  534. layout: 'form',
  535. items: [{
  536. xtype: 'textarea',
  537. style: {
  538. width: '95%',
  539. marginBottom: '10px'
  540. }
  541. },
  542. new Ext.Button({
  543. text: 'Send',
  544. minWidth: '100',
  545. style: {
  546. marginBottom: '10px'
  547. }
  548. })
  549. ]
  550. });
  551. * &lt;/code&gt;&lt;/pre&gt;
  552. */
  553. <span id='Ext-Component-cfg-ctCls'> /**
  554. </span> * @cfg {String} ctCls
  555. * &lt;p&gt;An optional extra CSS class that will be added to this component's container. This can be useful for
  556. * adding customized styles to the container or any of its children using standard CSS rules. See
  557. * {@link Ext.layout.ContainerLayout}.{@link Ext.layout.ContainerLayout#extraCls extraCls} also.&lt;/p&gt;
  558. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: &lt;tt&gt;ctCls&lt;/tt&gt; defaults to &lt;tt&gt;''&lt;/tt&gt; except for the following class
  559. * which assigns a value by default:
  560. * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
  561. * &lt;li&gt;{@link Ext.layout.Box Box Layout} : &lt;tt&gt;'x-box-layout-ct'&lt;/tt&gt;&lt;/li&gt;
  562. * &lt;/ul&gt;&lt;/div&gt;
  563. * To configure the above Class with an extra CSS class append to the default. For example,
  564. * for BoxLayout (Hbox and Vbox):&lt;pre&gt;&lt;code&gt;
  565. * ctCls: 'x-box-layout-ct custom-class'
  566. * &lt;/code&gt;&lt;/pre&gt;
  567. * &lt;/p&gt;
  568. */
  569. <span id='Ext-Component-cfg-disabled'> /**
  570. </span> * @cfg {Boolean} disabled
  571. * Render this component disabled (default is false).
  572. */
  573. disabled : false,
  574. <span id='Ext-Component-cfg-hidden'> /**
  575. </span> * @cfg {Boolean} hidden
  576. * Render this component hidden (default is false). If &lt;tt&gt;true&lt;/tt&gt;, the
  577. * {@link #hide} method will be called internally.
  578. */
  579. hidden : false,
  580. <span id='Ext-Component-cfg-plugins'> /**
  581. </span> * @cfg {Object/Array} plugins
  582. * An object or array of objects that will provide custom functionality for this component. The only
  583. * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component.
  584. * When a component is created, if any plugins are available, the component will call the init method on each
  585. * plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the
  586. * component as needed to provide its functionality.
  587. */
  588. <span id='Ext-Component-cfg-applyTo'> /**
  589. </span> * @cfg {Mixed} applyTo
  590. * &lt;p&gt;Specify the id of the element, a DOM element or an existing Element corresponding to a DIV
  591. * that is already present in the document that specifies some structural markup for this
  592. * component.&lt;/p&gt;&lt;div&gt;&lt;ul&gt;
  593. * &lt;li&gt;&lt;b&gt;Description&lt;/b&gt; : &lt;ul&gt;
  594. * &lt;div class=&quot;sub-desc&quot;&gt;When &lt;tt&gt;applyTo&lt;/tt&gt; is used, constituent parts of the component can also be specified
  595. * by id or CSS class name within the main element, and the component being created may attempt
  596. * to create its subcomponents from that markup if applicable.&lt;/div&gt;
  597. * &lt;/ul&gt;&lt;/li&gt;
  598. * &lt;li&gt;&lt;b&gt;Notes&lt;/b&gt; : &lt;ul&gt;
  599. * &lt;div class=&quot;sub-desc&quot;&gt;When using this config, a call to render() is not required.&lt;/div&gt;
  600. * &lt;div class=&quot;sub-desc&quot;&gt;If applyTo is specified, any value passed for {@link #renderTo} will be ignored and the target
  601. * element's parent node will automatically be used as the component's container.&lt;/div&gt;
  602. * &lt;/ul&gt;&lt;/li&gt;
  603. * &lt;/ul&gt;&lt;/div&gt;
  604. */
  605. <span id='Ext-Component-cfg-renderTo'> /**
  606. </span> * @cfg {Mixed} renderTo
  607. * &lt;p&gt;Specify the id of the element, a DOM element or an existing Element that this component
  608. * will be rendered into.&lt;/p&gt;&lt;div&gt;&lt;ul&gt;
  609. * &lt;li&gt;&lt;b&gt;Notes&lt;/b&gt; : &lt;ul&gt;
  610. * &lt;div class=&quot;sub-desc&quot;&gt;Do &lt;u&gt;not&lt;/u&gt; use this option if the Component is to be a child item of
  611. * a {@link Ext.Container Container}. It is the responsibility of the
  612. * {@link Ext.Container Container}'s {@link Ext.Container#layout layout manager}
  613. * to render and manage its child items.&lt;/div&gt;
  614. * &lt;div class=&quot;sub-desc&quot;&gt;When using this config, a call to render() is not required.&lt;/div&gt;
  615. * &lt;/ul&gt;&lt;/li&gt;
  616. * &lt;/ul&gt;&lt;/div&gt;
  617. * &lt;p&gt;See &lt;tt&gt;{@link #render}&lt;/tt&gt; also.&lt;/p&gt;
  618. */
  619. <span id='Ext-Component-cfg-stateful'> /**
  620. </span> * @cfg {Boolean} stateful
  621. * &lt;p&gt;A flag which causes the Component to attempt to restore the state of
  622. * internal properties from a saved state on startup. The component must have
  623. * either a &lt;code&gt;{@link #stateId}&lt;/code&gt; or &lt;code&gt;{@link #id}&lt;/code&gt; assigned
  624. * for state to be managed. Auto-generated ids are not guaranteed to be stable
  625. * across page loads and cannot be relied upon to save and restore the same
  626. * state for a component.&lt;p&gt;
  627. * &lt;p&gt;For state saving to work, the state manager's provider must have been
  628. * set to an implementation of {@link Ext.state.Provider} which overrides the
  629. * {@link Ext.state.Provider#set set} and {@link Ext.state.Provider#get get}
  630. * methods to save and recall name/value pairs. A built-in implementation,
  631. * {@link Ext.state.CookieProvider} is available.&lt;/p&gt;
  632. * &lt;p&gt;To set the state provider for the current page:&lt;/p&gt;
  633. * &lt;pre&gt;&lt;code&gt;
  634. Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
  635. expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
  636. }));
  637. * &lt;/code&gt;&lt;/pre&gt;
  638. * &lt;p&gt;A stateful Component attempts to save state when one of the events
  639. * listed in the &lt;code&gt;{@link #stateEvents}&lt;/code&gt; configuration fires.&lt;/p&gt;
  640. * &lt;p&gt;To save state, a stateful Component first serializes its state by
  641. * calling &lt;b&gt;&lt;code&gt;getState&lt;/code&gt;&lt;/b&gt;. By default, this function does
  642. * nothing. The developer must provide an implementation which returns an
  643. * object hash which represents the Component's restorable state.&lt;/p&gt;
  644. * &lt;p&gt;The value yielded by getState is passed to {@link Ext.state.Manager#set}
  645. * which uses the configured {@link Ext.state.Provider} to save the object
  646. * keyed by the Component's &lt;code&gt;{@link stateId}&lt;/code&gt;, or, if that is not
  647. * specified, its &lt;code&gt;{@link #id}&lt;/code&gt;.&lt;/p&gt;
  648. * &lt;p&gt;During construction, a stateful Component attempts to &lt;i&gt;restore&lt;/i&gt;
  649. * its state by calling {@link Ext.state.Manager#get} passing the
  650. * &lt;code&gt;{@link #stateId}&lt;/code&gt;, or, if that is not specified, the
  651. * &lt;code&gt;{@link #id}&lt;/code&gt;.&lt;/p&gt;
  652. * &lt;p&gt;The resulting object is passed to &lt;b&gt;&lt;code&gt;applyState&lt;/code&gt;&lt;/b&gt;.
  653. * The default implementation of &lt;code&gt;applyState&lt;/code&gt; simply copies
  654. * properties into the object, but a developer may override this to support
  655. * more behaviour.&lt;/p&gt;
  656. * &lt;p&gt;You can perform extra processing on state save and restore by attaching
  657. * handlers to the {@link #beforestaterestore}, {@link #staterestore},
  658. * {@link #beforestatesave} and {@link #statesave} events.&lt;/p&gt;
  659. */
  660. <span id='Ext-Component-cfg-stateId'> /**
  661. </span> * @cfg {String} stateId
  662. * The unique id for this component to use for state management purposes
  663. * (defaults to the component id if one was set, otherwise null if the
  664. * component is using a generated id).
  665. * &lt;p&gt;See &lt;code&gt;{@link #stateful}&lt;/code&gt; for an explanation of saving and
  666. * restoring Component state.&lt;/p&gt;
  667. */
  668. <span id='Ext-Component-cfg-stateEvents'> /**
  669. </span> * @cfg {Array} stateEvents
  670. * &lt;p&gt;An array of events that, when fired, should trigger this component to
  671. * save its state (defaults to none). &lt;code&gt;stateEvents&lt;/code&gt; may be any type
  672. * of event supported by this component, including browser or custom events
  673. * (e.g., &lt;tt&gt;['click', 'customerchange']&lt;/tt&gt;).&lt;/p&gt;
  674. * &lt;p&gt;See &lt;code&gt;{@link #stateful}&lt;/code&gt; for an explanation of saving and
  675. * restoring Component state.&lt;/p&gt;
  676. */
  677. <span id='Ext-Component-cfg-autoEl'> /**
  678. </span> * @cfg {Mixed} autoEl
  679. * &lt;p&gt;A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
  680. * encapsulate this Component.&lt;/p&gt;
  681. * &lt;p&gt;You do not normally need to specify this. For the base classes {@link Ext.Component}, {@link Ext.BoxComponent},
  682. * and {@link Ext.Container}, this defaults to &lt;b&gt;&lt;tt&gt;'div'&lt;/tt&gt;&lt;/b&gt;. The more complex Ext classes use a more complex
  683. * DOM structure created by their own onRender methods.&lt;/p&gt;
  684. * &lt;p&gt;This is intended to allow the developer to create application-specific utility Components encapsulated by
  685. * different DOM elements. Example usage:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  686. {
  687. xtype: 'box',
  688. autoEl: {
  689. tag: 'img',
  690. src: 'http://www.example.com/example.jpg'
  691. }
  692. }, {
  693. xtype: 'box',
  694. autoEl: {
  695. tag: 'blockquote',
  696. html: 'autoEl is cool!'
  697. }
  698. }, {
  699. xtype: 'container',
  700. autoEl: 'ul',
  701. cls: 'ux-unordered-list',
  702. items: {
  703. xtype: 'box',
  704. autoEl: 'li',
  705. html: 'First list item'
  706. }
  707. }
  708. &lt;/code&gt;&lt;/pre&gt;
  709. */
  710. autoEl : 'div',
  711. <span id='Ext-Component-cfg-disabledClass'> /**
  712. </span> * @cfg {String} disabledClass
  713. * CSS class added to the component when it is disabled (defaults to 'x-item-disabled').
  714. */
  715. disabledClass : 'x-item-disabled',
  716. <span id='Ext-Component-cfg-allowDomMove'> /**
  717. </span> * @cfg {Boolean} allowDomMove
  718. * Whether the component can move the Dom node when rendering (defaults to true).
  719. */
  720. allowDomMove : true,
  721. <span id='Ext-Component-cfg-autoShow'> /**
  722. </span> * @cfg {Boolean} autoShow
  723. * True if the component should check for hidden classes (e.g. 'x-hidden' or 'x-hide-display') and remove
  724. * them on render (defaults to false).
  725. */
  726. autoShow : false,
  727. <span id='Ext-Component-cfg-hideMode'> /**
  728. </span> * @cfg {String} hideMode
  729. * &lt;p&gt;How this component should be hidden. Supported values are &lt;tt&gt;'visibility'&lt;/tt&gt;
  730. * (css visibility), &lt;tt&gt;'offsets'&lt;/tt&gt; (negative offset position) and &lt;tt&gt;'display'&lt;/tt&gt;
  731. * (css display).&lt;/p&gt;
  732. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: the default of &lt;tt&gt;'display'&lt;/tt&gt; is generally preferred
  733. * since items are automatically laid out when they are first shown (no sizing
  734. * is done while hidden).&lt;/p&gt;
  735. */
  736. hideMode : 'display',
  737. <span id='Ext-Component-cfg-hideParent'> /**
  738. </span> * @cfg {Boolean} hideParent
  739. * True to hide and show the component's container when hide/show is called on the component, false to hide
  740. * and show the component itself (defaults to false). For example, this can be used as a shortcut for a hide
  741. * button on a window by setting hide:true on the button when adding it to its parent container.
  742. */
  743. hideParent : false,
  744. <span id='Ext-Component-property-el'> /**
  745. </span> * &lt;p&gt;The {@link Ext.Element} which encapsulates this Component. Read-only.&lt;/p&gt;
  746. * &lt;p&gt;This will &lt;i&gt;usually&lt;/i&gt; be a &amp;lt;DIV&gt; element created by the class's onRender method, but
  747. * that may be overridden using the &lt;code&gt;{@link #autoEl}&lt;/code&gt; config.&lt;/p&gt;
  748. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this element will not be available until this Component has been rendered.&lt;/p&gt;&lt;br&gt;
  749. * &lt;p&gt;To add listeners for &lt;b&gt;DOM events&lt;/b&gt; to this Component (as opposed to listeners
  750. * for this Component's own Observable events), see the {@link Ext.util.Observable#listeners listeners}
  751. * config for a suggestion, or use a render listener directly:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  752. new Ext.Panel({
  753. title: 'The Clickable Panel',
  754. listeners: {
  755. render: function(p) {
  756. // Append the Panel to the click handler&amp;#39;s argument list.
  757. p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
  758. },
  759. single: true // Remove the listener after first invocation
  760. }
  761. });
  762. &lt;/code&gt;&lt;/pre&gt;
  763. * &lt;p&gt;See also &lt;tt&gt;{@link #getEl getEl}&lt;/tt&gt;&lt;/p&gt;
  764. * @type Ext.Element
  765. * @property el
  766. */
  767. <span id='Ext-Component-property-ownerCt'> /**
  768. </span> * This Component's owner {@link Ext.Container Container} (defaults to undefined, and is set automatically when
  769. * this Component is added to a Container). Read-only.
  770. * &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: to access items within the Container see &lt;tt&gt;{@link #itemId}&lt;/tt&gt;.&lt;/p&gt;
  771. * @type Ext.Container
  772. * @property ownerCt
  773. */
  774. <span id='Ext-Component-property-hidden'> /**
  775. </span> * True if this component is hidden. Read-only.
  776. * @type Boolean
  777. * @property hidden
  778. */
  779. <span id='Ext-Component-property-disabled'> /**
  780. </span> * True if this component is disabled. Read-only.
  781. * @type Boolean
  782. * @property disabled
  783. */
  784. <span id='Ext-Component-property-rendered'> /**
  785. </span> * True if this component has been rendered. Read-only.
  786. * @type Boolean
  787. * @property rendered
  788. */
  789. rendered : false,
  790. <span id='Ext-Component-cfg-contentEl'> /**
  791. </span> * @cfg {String} contentEl
  792. * &lt;p&gt;Optional. Specify an existing HTML element, or the &lt;code&gt;id&lt;/code&gt; of an existing HTML element to use as the content
  793. * for this component.&lt;/p&gt;
  794. * &lt;ul&gt;
  795. * &lt;li&gt;&lt;b&gt;Description&lt;/b&gt; :
  796. * &lt;div class=&quot;sub-desc&quot;&gt;This config option is used to take an existing HTML element and place it in the layout element
  797. * of a new component (it simply moves the specified DOM element &lt;i&gt;after the Component is rendered&lt;/i&gt; to use as the content.&lt;/div&gt;&lt;/li&gt;
  798. * &lt;li&gt;&lt;b&gt;Notes&lt;/b&gt; :
  799. * &lt;div class=&quot;sub-desc&quot;&gt;The specified HTML element is appended to the layout element of the component &lt;i&gt;after any configured
  800. * {@link #html HTML} has been inserted&lt;/i&gt;, and so the document will not contain this element at the time the {@link #render} event is fired.&lt;/div&gt;
  801. * &lt;div class=&quot;sub-desc&quot;&gt;The specified HTML element used will not participate in any &lt;code&gt;&lt;b&gt;{@link Ext.Container#layout layout}&lt;/b&gt;&lt;/code&gt;
  802. * scheme that the Component may use. It is just HTML. Layouts operate on child &lt;code&gt;&lt;b&gt;{@link Ext.Container#items items}&lt;/b&gt;&lt;/code&gt;.&lt;/div&gt;
  803. * &lt;div class=&quot;sub-desc&quot;&gt;Add either the &lt;code&gt;x-hidden&lt;/code&gt; or the &lt;code&gt;x-hide-display&lt;/code&gt; CSS class to
  804. * prevent a brief flicker of the content before it is rendered to the panel.&lt;/div&gt;&lt;/li&gt;
  805. * &lt;/ul&gt;
  806. */
  807. <span id='Ext-Component-cfg-html'> /**
  808. </span> * @cfg {String/Object} html
  809. * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use as the layout element
  810. * content (defaults to ''). The HTML content is added after the component is rendered,
  811. * so the document will not contain this HTML at the time the {@link #render} event is fired.
  812. * This content is inserted into the body &lt;i&gt;before&lt;/i&gt; any configured {@link #contentEl} is appended.
  813. */
  814. <span id='Ext-Component-cfg-tpl'> /**
  815. </span> * @cfg {Mixed} tpl
  816. * An &lt;bold&gt;{@link Ext.Template}&lt;/bold&gt;, &lt;bold&gt;{@link Ext.XTemplate}&lt;/bold&gt;
  817. * or an array of strings to form an Ext.XTemplate.
  818. * Used in conjunction with the &lt;code&gt;{@link #data}&lt;/code&gt; and
  819. * &lt;code&gt;{@link #tplWriteMode}&lt;/code&gt; configurations.
  820. */
  821. <span id='Ext-Component-cfg-tplWriteMode'> /**
  822. </span> * @cfg {String} tplWriteMode The Ext.(X)Template method to use when
  823. * updating the content area of the Component. Defaults to &lt;tt&gt;'overwrite'&lt;/tt&gt;
  824. * (see &lt;code&gt;{@link Ext.XTemplate#overwrite}&lt;/code&gt;).
  825. */
  826. tplWriteMode : 'overwrite',
  827. <span id='Ext-Component-cfg-data'> /**
  828. </span> * @cfg {Mixed} data
  829. * The initial set of data to apply to the &lt;code&gt;{@link #tpl}&lt;/code&gt; to
  830. * update the content area of the Component.
  831. */
  832. <span id='Ext-Component-cfg-bubbleEvents'> /**
  833. </span> * @cfg {Array} bubbleEvents
  834. * &lt;p&gt;An array of events that, when fired, should be bubbled to any parent container.
  835. * See {@link Ext.util.Observable#enableBubble}.
  836. * Defaults to &lt;tt&gt;[]&lt;/tt&gt;.
  837. */
  838. bubbleEvents: [],
  839. // private
  840. ctype : 'Ext.Component',
  841. // private
  842. actionMode : 'el',
  843. // private
  844. getActionEl : function(){
  845. return this[this.actionMode];
  846. },
  847. initPlugin : function(p){
  848. if(p.ptype &amp;&amp; !Ext.isFunction(p.init)){
  849. p = Ext.ComponentMgr.createPlugin(p);
  850. }else if(Ext.isString(p)){
  851. p = Ext.ComponentMgr.createPlugin({
  852. ptype: p
  853. });
  854. }
  855. p.init(this);
  856. return p;
  857. },
  858. /* // protected
  859. * Function to be implemented by Component subclasses to be part of standard component initialization flow (it is empty by default).
  860. * &lt;pre&gt;&lt;code&gt;
  861. // Traditional constructor:
  862. Ext.Foo = function(config){
  863. // call superclass constructor:
  864. Ext.Foo.superclass.constructor.call(this, config);
  865. this.addEvents({
  866. // add events
  867. });
  868. };
  869. Ext.extend(Ext.Foo, Ext.Bar, {
  870. // class body
  871. }
  872. // initComponent replaces the constructor:
  873. Ext.Foo = Ext.extend(Ext.Bar, {
  874. initComponent : function(){
  875. // call superclass initComponent
  876. Ext.Container.superclass.initComponent.call(this);
  877. this.addEvents({
  878. // add events
  879. });
  880. }
  881. }
  882. &lt;/code&gt;&lt;/pre&gt;
  883. */
  884. initComponent : function(){
  885. /*
  886. * this is double processing, however it allows people to be able to do
  887. * Ext.apply(this, {
  888. * listeners: {
  889. * //here
  890. * }
  891. * });
  892. * MyClass.superclass.initComponent.call(this);
  893. */
  894. if(this.listeners){
  895. this.on(this.listeners);
  896. delete this.listeners;
  897. }
  898. this.enableBubble(this.bubbleEvents);
  899. },
  900. <span id='Ext-Component-method-render'> /**
  901. </span> * &lt;p&gt;Render this Component into the passed HTML element.&lt;/p&gt;
  902. * &lt;p&gt;&lt;b&gt;If you are using a {@link Ext.Container Container} object to house this Component, then
  903. * do not use the render method.&lt;/b&gt;&lt;/p&gt;
  904. * &lt;p&gt;A Container's child Components are rendered by that Container's
  905. * {@link Ext.Container#layout layout} manager when the Container is first rendered.&lt;/p&gt;
  906. * &lt;p&gt;Certain layout managers allow dynamic addition of child components. Those that do
  907. * include {@link Ext.layout.CardLayout}, {@link Ext.layout.AnchorLayout},
  908. * {@link Ext.layout.FormLayout}, {@link Ext.layout.TableLayout}.&lt;/p&gt;
  909. * &lt;p&gt;If the Container is already rendered when a new child Component is added, you may need to call
  910. * the Container's {@link Ext.Container#doLayout doLayout} to refresh the view which causes any
  911. * unrendered child Components to be rendered. This is required so that you can add multiple
  912. * child components if needed while only refreshing the layout once.&lt;/p&gt;
  913. * &lt;p&gt;When creating complex UIs, it is important to remember that sizing and positioning
  914. * of child items is the responsibility of the Container's {@link Ext.Container#layout layout} manager.
  915. * If you expect child items to be sized in response to user interactions, you must
  916. * configure the Container with a layout manager which creates and manages the type of layout you
  917. * have in mind.&lt;/p&gt;
  918. * &lt;p&gt;&lt;b&gt;Omitting the Container's {@link Ext.Container#layout layout} config means that a basic
  919. * layout manager is used which does nothing but render child components sequentially into the
  920. * Container. No sizing or positioning will be performed in this situation.&lt;/b&gt;&lt;/p&gt;
  921. * @param {Element/HTMLElement/String} container (optional) The element this Component should be
  922. * rendered into. If it is being created from existing markup, this should be omitted.
  923. * @param {String/Number} position (optional) The element ID or DOM node index within the container &lt;b&gt;before&lt;/b&gt;
  924. * which this component will be inserted (defaults to appending to the end of the container)
  925. */
  926. render : function(container, position){
  927. if(!this.rendered &amp;&amp; this.fireEvent('beforerender', this) !== false){
  928. if(!container &amp;&amp; this.el){
  929. this.el = Ext.get(this.el);
  930. container = this.el.dom.parentNode;
  931. this.allowDomMove = false;
  932. }
  933. this.container = Ext.get(container);
  934. if(this.ctCls){
  935. this.container.addClass(this.ctCls);
  936. }
  937. this.rendered = true;
  938. if(position !== undefined){
  939. if(Ext.isNumber(position)){
  940. position = this.container.dom.childNodes[position];
  941. }else{
  942. position = Ext.getDom(position);
  943. }
  944. }
  945. this.onRender(this.container, position || null);
  946. if(this.autoShow){
  947. this.el.removeClass(['x-hidden','x-hide-' + this.hideMode]);
  948. }
  949. if(this.cls){
  950. this.el.addClass(this.cls);
  951. delete this.cls;
  952. }
  953. if(this.style){
  954. this.el.applyStyles(this.style);
  955. delete this.style;
  956. }
  957. if(this.overCls){
  958. this.el.addClassOnOver(this.overCls);
  959. }
  960. this.fireEvent('render', this);
  961. // Populate content of the component with html, contentEl or
  962. // a tpl.
  963. var contentTarget = this.getContentTarget();
  964. if (this.html){
  965. contentTarget.update(Ext.DomHelper.markup(this.html));
  966. delete this.html;
  967. }
  968. if (this.contentEl){
  969. var ce = Ext.getDom(this.contentEl);
  970. Ext.fly(ce).removeClass(['x-hidden', 'x-hide-display']);
  971. contentTarget.appendChild(ce);
  972. }
  973. if (this.tpl) {
  974. if (!this.tpl.compile) {
  975. this.tpl = new Ext.XTemplate(this.tpl);
  976. }
  977. if (this.data) {
  978. this.tpl[this.tplWriteMode](contentTarget, this.data);
  979. delete this.data;
  980. }
  981. }
  982. this.afterRender(this.container);
  983. if(this.hidden){
  984. // call this so we don't fire initial hide events.
  985. this.doHide();
  986. }
  987. if(this.disabled){
  988. // pass silent so the event doesn't fire the first time.
  989. this.disable(true);
  990. }
  991. if(this.stateful !== false){
  992. this.initStateEvents();
  993. }
  994. this.fireEvent('afterrender', this);
  995. }
  996. return this;
  997. },
  998. <span id='Ext-Component-method-update'> /**
  999. </span> * Update the content area of a component.
  1000. * @param {Mixed} htmlOrData
  1001. * If this component has been configured with a template via the tpl config
  1002. * then it will use this argument as data to populate the template.
  1003. * If this component was not configured with a template, the components
  1004. * content area will be updated via Ext.Element update
  1005. * @param {Boolean} loadScripts
  1006. * (optional) Only legitimate when using the html configuration. Defaults to false
  1007. * @param {Function} callback
  1008. * (optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
  1009. */
  1010. update: function(htmlOrData, loadScripts, cb) {
  1011. var contentTarget = this.getContentTarget();
  1012. if (this.tpl &amp;&amp; typeof htmlOrData !== &quot;string&quot;) {
  1013. this.tpl[this.tplWriteMode](contentTarget, htmlOrData || {});
  1014. } else {
  1015. var html = Ext.isObject(htmlOrData) ? Ext.DomHelper.markup(htmlOrData) : htmlOrData;
  1016. contentTarget.update(html, loadScripts, cb);
  1017. }
  1018. },
  1019. <span id='Ext-Component-method-onAdded'> /**
  1020. </span> * @private
  1021. * Method to manage awareness of when components are added to their
  1022. * respective Container, firing an added event.
  1023. * References are established at add time rather than at render time.
  1024. * @param {Ext.Container} container Container which holds the component
  1025. * @param {number} pos Position at which the component was added
  1026. */
  1027. onAdded : function(container, pos) {
  1028. this.ownerCt = container;
  1029. this.initRef();
  1030. this.fireEvent('added', this, container, pos);
  1031. },
  1032. <span id='Ext-Component-method-onRemoved'> /**
  1033. </span> * @private
  1034. * Method to manage awareness of when components are removed from their
  1035. * respective Container, firing an removed event. References are properly
  1036. * cleaned up after removing a component from its owning container.
  1037. */
  1038. onRemoved : function() {
  1039. this.removeRef();
  1040. this.fireEvent('removed', this, this.ownerCt);
  1041. delete this.ownerCt;
  1042. },
  1043. <span id='Ext-Component-method-initRef'> /**
  1044. </span> * @private
  1045. * Method to establish a reference to a component.
  1046. */
  1047. initRef : function() {
  1048. <span id='Ext-Component-cfg-ref'> /**
  1049. </span> * @cfg {String} ref
  1050. * &lt;p&gt;A path specification, relative to the Component's &lt;code&gt;{@link #ownerCt}&lt;/code&gt;
  1051. * specifying into which ancestor Container to place a named reference to this Component.&lt;/p&gt;
  1052. * &lt;p&gt;The ancestor axis can be traversed by using '/' characters in the path.
  1053. * For example, to put a reference to a Toolbar Button into &lt;i&gt;the Panel which owns the Toolbar&lt;/i&gt;:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  1054. var myGrid = new Ext.grid.EditorGridPanel({
  1055. title: 'My EditorGridPanel',
  1056. store: myStore,
  1057. colModel: myColModel,
  1058. tbar: [{
  1059. text: 'Save',
  1060. handler: saveChanges,
  1061. disabled: true,
  1062. ref: '../saveButton'
  1063. }],
  1064. listeners: {
  1065. afteredit: function() {
  1066. // The button reference is in the GridPanel
  1067. myGrid.saveButton.enable();
  1068. }
  1069. }
  1070. });
  1071. &lt;/code&gt;&lt;/pre&gt;
  1072. * &lt;p&gt;In the code above, if the &lt;code&gt;ref&lt;/code&gt; had been &lt;code&gt;'saveButton'&lt;/code&gt;
  1073. * the reference would have been placed into the Toolbar. Each '/' in the &lt;code&gt;ref&lt;/code&gt;
  1074. * moves up one level from the Component's &lt;code&gt;{@link #ownerCt}&lt;/code&gt;.&lt;/p&gt;
  1075. * &lt;p&gt;Also see the &lt;code&gt;{@link #added}&lt;/code&gt; and &lt;code&gt;{@link #removed}&lt;/code&gt; events.&lt;/p&gt;
  1076. */
  1077. if(this.ref &amp;&amp; !this.refOwner){
  1078. var levels = this.ref.split('/'),
  1079. last = levels.length,
  1080. i = 0,
  1081. t = this;
  1082. while(t &amp;&amp; i &lt; last){
  1083. t = t.ownerCt;
  1084. ++i;
  1085. }
  1086. if(t){
  1087. t[this.refName = levels[--i]] = this;
  1088. <span id='Ext-Component-property-refOwner'> /**
  1089. </span> * @type Ext.Container
  1090. * @property refOwner
  1091. * The ancestor Container into which the {@link #ref} reference was inserted if this Component
  1092. * is a child of a Container, and has been configured with a &lt;code&gt;ref&lt;/code&gt;.
  1093. */
  1094. this.refOwner = t;
  1095. }
  1096. }
  1097. },
  1098. removeRef : function() {
  1099. if (this.refOwner &amp;&amp; this.refName) {
  1100. delete this.refOwner[this.refName];
  1101. delete this.refOwner;
  1102. }
  1103. },
  1104. // private
  1105. initState : function(){
  1106. if(Ext.state.Manager){
  1107. var id = this.getStateId();
  1108. if(id){
  1109. var state = Ext.state.Manager.get(id);
  1110. if(state){
  1111. if(this.fireEvent('beforestaterestore', this, state) !== false){
  1112. this.applyState(Ext.apply({}, state));
  1113. this.fireEvent('staterestore', this, state);
  1114. }
  1115. }
  1116. }
  1117. }
  1118. },
  1119. // private
  1120. getStateId : function(){
  1121. return this.stateId || ((/^(ext-comp-|ext-gen)/).test(String(this.id)) ? null : this.id);
  1122. },
  1123. // private
  1124. initStateEvents : function(){
  1125. if(this.stateEvents){
  1126. for(var i = 0, e; e = this.stateEvents[i]; i++){
  1127. this.on(e, this.saveState, this, {delay:100});
  1128. }
  1129. }
  1130. },
  1131. // private
  1132. applyState : function(state){
  1133. if(state){
  1134. Ext.apply(this, state);
  1135. }
  1136. },
  1137. // private
  1138. getState : function(){
  1139. return null;
  1140. },
  1141. // private
  1142. saveState : function(){
  1143. if(Ext.state.Manager &amp;&amp; this.stateful !== false){
  1144. var id = this.getStateId();
  1145. if(id){
  1146. var state = this.getState();
  1147. if(this.fireEvent('beforestatesave', this, state) !== false){
  1148. Ext.state.Manager.set(id, state);
  1149. this.fireEvent('statesave', this, state);
  1150. }
  1151. }
  1152. }
  1153. },
  1154. <span id='Ext-Component-method-applyToMarkup'> /**
  1155. </span> * Apply this component to existing markup that is valid. With this function, no call to render() is required.
  1156. * @param {String/HTMLElement} el
  1157. */
  1158. applyToMarkup : function(el){
  1159. this.allowDomMove = false;
  1160. this.el = Ext.get(el);
  1161. this.render(this.el.dom.parentNode);
  1162. },
  1163. <span id='Ext-Component-method-addClass'> /**
  1164. </span> * Adds a CSS class to the component's underlying element.
  1165. * @param {string} cls The CSS class name to add
  1166. * @return {Ext.Component} this
  1167. */
  1168. addClass : function(cls){
  1169. if(this.el){
  1170. this.el.addClass(cls);
  1171. }else{
  1172. this.cls = this.cls ? this.cls + ' ' + cls : cls;
  1173. }
  1174. return this;
  1175. },
  1176. <span id='Ext-Component-method-removeClass'> /**
  1177. </span> * Removes a CSS class from the component's underlying element.
  1178. * @param {string} cls The CSS class name to remove
  1179. * @return {Ext.Component} this
  1180. */
  1181. removeClass : function(cls){
  1182. if(this.el){
  1183. this.el.removeClass(cls);
  1184. }else if(this.cls){
  1185. this.cls = this.cls.split(' ').remove(cls).join(' ');
  1186. }
  1187. return this;
  1188. },
  1189. // private
  1190. // default function is not really useful
  1191. onRender : function(ct, position){
  1192. if(!this.el &amp;&amp; this.autoEl){
  1193. if(Ext.isString(this.autoEl)){
  1194. this.el = document.createElement(this.autoEl);
  1195. }else{
  1196. var div = document.createElement('div');
  1197. Ext.DomHelper.overwrite(div, this.autoEl);
  1198. this.el = div.firstChild;
  1199. }
  1200. if (!this.el.id) {
  1201. this.el.id = this.getId();
  1202. }
  1203. }
  1204. if(this.el){
  1205. this.el = Ext.get(this.el);
  1206. if(this.allowDomMove !== false){
  1207. ct.dom.insertBefore(this.el.dom, position);
  1208. if (div) {
  1209. Ext.removeNode(div);
  1210. div = null;
  1211. }
  1212. }
  1213. }
  1214. },
  1215. // private
  1216. getAutoCreate : function(){
  1217. var cfg = Ext.isObject(this.autoCreate) ?
  1218. this.autoCreate : Ext.apply({}, this.defaultAutoCreate);
  1219. if(this.id &amp;&amp; !cfg.id){
  1220. cfg.id = this.id;
  1221. }
  1222. return cfg;
  1223. },
  1224. // private
  1225. afterRender : Ext.emptyFn,
  1226. <span id='Ext-Component-method-destroy'> /**
  1227. </span> * Destroys this component by purging any event listeners, removing the component's element from the DOM,
  1228. * removing the component from its {@link Ext.Container} (if applicable) and unregistering it from
  1229. * {@link Ext.ComponentMgr}. Destruction is generally handled automatically by the framework and this method
  1230. * should usually not need to be called directly.
  1231. *
  1232. */
  1233. destroy : function(){
  1234. if(!this.isDestroyed){
  1235. if(this.fireEvent('beforedestroy', this) !== false){
  1236. this.destroying = true;
  1237. this.beforeDestroy();
  1238. if(this.ownerCt &amp;&amp; this.ownerCt.remove){
  1239. this.ownerCt.remove(this, false);
  1240. }
  1241. if(this.rendered){
  1242. this.el.remove();
  1243. if(this.actionMode == 'container' || this.removeMode == 'container'){
  1244. this.container.remove();
  1245. }
  1246. }
  1247. // Stop any buffered tasks
  1248. if(this.focusTask &amp;&amp; this.focusTask.cancel){
  1249. this.focusTask.cancel();
  1250. }
  1251. this.onDestroy();
  1252. Ext.ComponentMgr.unregister(this);
  1253. this.fireEvent('destroy', this);
  1254. this.purgeListeners();
  1255. this.destroying = false;
  1256. this.isDestroyed = true;
  1257. }
  1258. }
  1259. },
  1260. deleteMembers : function(){
  1261. var args = arguments;
  1262. for(var i = 0, len = args.length; i &lt; len; ++i){
  1263. delete this[args[i]];
  1264. }
  1265. },
  1266. // private
  1267. beforeDestroy : Ext.emptyFn,
  1268. // private
  1269. onDestroy : Ext.emptyFn,
  1270. <span id='Ext-Component-method-getEl'> /**
  1271. </span> * &lt;p&gt;Returns the {@link Ext.Element} which encapsulates this Component.&lt;/p&gt;
  1272. * &lt;p&gt;This will &lt;i&gt;usually&lt;/i&gt; be a &amp;lt;DIV&gt; element created by the class's onRender method, but
  1273. * that may be overridden using the {@link #autoEl} config.&lt;/p&gt;
  1274. * &lt;br&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: this element will not be available until this Component has been rendered.&lt;/p&gt;&lt;br&gt;
  1275. * &lt;p&gt;To add listeners for &lt;b&gt;DOM events&lt;/b&gt; to this Component (as opposed to listeners
  1276. * for this Component's own Observable events), see the {@link #listeners} config for a suggestion,
  1277. * or use a render listener directly:&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
  1278. new Ext.Panel({
  1279. title: 'The Clickable Panel',
  1280. listeners: {
  1281. render: function(p) {
  1282. // Append the Panel to the click handler&amp;#39;s argument list.
  1283. p.getEl().on('click', handlePanelClick.createDelegate(null, [p], true));
  1284. },
  1285. single: true // Remove the listener after first invocation
  1286. }
  1287. });
  1288. &lt;/code&gt;&lt;/pre&gt;
  1289. * @return {Ext.Element} The Element which encapsulates this Component.
  1290. */
  1291. getEl : function(){
  1292. return this.el;
  1293. },
  1294. // private
  1295. getContentTarget : function(){
  1296. return this.el;
  1297. },
  1298. <span id='Ext-Component-method-getId'> /**
  1299. </span> * Returns the &lt;code&gt;id&lt;/code&gt; of this component or automatically generates and
  1300. * returns an &lt;code&gt;id&lt;/code&gt; if an &lt;code&gt;id&lt;/code&gt; is not defined yet:&lt;pre&gt;&lt;code&gt;
  1301. * 'ext-comp-' + (++Ext.Component.AUTO_ID)
  1302. * &lt;/code&gt;&lt;/pre&gt;
  1303. * @return {String} id
  1304. */
  1305. getId : function(){
  1306. return this.id || (this.id = 'ext-comp-' + (++Ext.Component.AUTO_ID));
  1307. },
  1308. <span id='Ext-Component-method-getItemId'> /**
  1309. </span> * Returns the &lt;code&gt;{@link #itemId}&lt;/code&gt; of this component. If an
  1310. * &lt;code&gt;{@link #itemId}&lt;/code&gt; was not assigned through configuration the
  1311. * &lt;code&gt;id&lt;/code&gt; is returned using &lt;code&gt;{@link #getId}&lt;/code&gt;.
  1312. * @return {String}
  1313. */
  1314. getItemId : function(){
  1315. return this.itemId || this.getId();
  1316. },
  1317. <span id='Ext-Component-method-focus'> /**
  1318. </span> * Try to focus this component.
  1319. * @param {Boolean} selectText (optional) If applicable, true to also select the text in this component
  1320. * @param {Boolean/Number} delay (optional) Delay the focus this number of milliseconds (true for 10 milliseconds)
  1321. * @return {Ext.Component} this
  1322. */
  1323. focus : function(selectText, delay){
  1324. if(delay){
  1325. this.focusTask = new Ext.util.DelayedTask(this.focus, this, [selectText, false]);
  1326. this.focusTask.delay(Ext.isNumber(delay) ? delay : 10);
  1327. return this;
  1328. }
  1329. if(this.rendered &amp;&amp; !this.isDestroyed){
  1330. this.el.focus();
  1331. if(selectText === true){
  1332. this.el.dom.select();
  1333. }
  1334. }
  1335. return this;
  1336. },
  1337. // private
  1338. blur : function(){
  1339. if(this.rendered){
  1340. this.el.blur();
  1341. }
  1342. return this;
  1343. },
  1344. <span id='Ext-Component-method-disable'> /**
  1345. </span> * Disable this component and fire the 'disable' event.
  1346. * @return {Ext.Component} this
  1347. */
  1348. disable : function(/* private */ silent){
  1349. if(this.rendered){
  1350. this.onDisable();
  1351. }
  1352. this.disabled = true;
  1353. if(silent !== true){
  1354. this.fireEvent('disable', this);
  1355. }
  1356. return this;
  1357. },
  1358. // private
  1359. onDisable : function(){
  1360. this.getActionEl().addClass(this.disabledClass);
  1361. this.el.dom.disabled = true;
  1362. },
  1363. <span id='Ext-Component-method-enable'> /**
  1364. </span> * Enable this component and fire the 'enable' event.
  1365. * @return {Ext.Component} this
  1366. */
  1367. enable : function(){
  1368. if(this.rendered){
  1369. this.onEnable();
  1370. }
  1371. this.disabled = false;
  1372. this.fireEvent('enable', this);
  1373. return this;
  1374. },
  1375. // private
  1376. onEnable : function(){
  1377. this.getActionEl().removeClass(this.disabledClass);
  1378. this.el.dom.disabled = false;
  1379. },
  1380. <span id='Ext-Component-method-setDisabled'> /**
  1381. </span> * Convenience function for setting disabled/enabled by boolean.
  1382. * @param {Boolean} disabled
  1383. * @return {Ext.Component} this
  1384. */
  1385. setDisabled : function(disabled){
  1386. return this[disabled ? 'disable' : 'enable']();
  1387. },
  1388. <span id='Ext-Component-method-show'> /**
  1389. </span> * Show this component. Listen to the '{@link #beforeshow}' event and return
  1390. * &lt;tt&gt;false&lt;/tt&gt; to cancel showing the component. Fires the '{@link #show}'
  1391. * event after showing the component.
  1392. * @return {Ext.Component} this
  1393. */
  1394. show : function(){
  1395. if(this.fireEvent('beforeshow', this) !== false){
  1396. this.hidden = false;
  1397. if(this.autoRender){
  1398. this.render(Ext.isBoolean(this.autoRender) ? Ext.getBody() : this.autoRender);
  1399. }
  1400. if(this.rendered){
  1401. this.onShow();
  1402. }
  1403. this.fireEvent('show', this);
  1404. }
  1405. return this;
  1406. },
  1407. // private
  1408. onShow : function(){
  1409. this.getVisibilityEl().removeClass('x-hide-' + this.hideMode);
  1410. },
  1411. <span id='Ext-Component-method-hide'> /**
  1412. </span> * Hide this component. Listen to the '{@link #beforehide}' event and return
  1413. * &lt;tt&gt;false&lt;/tt&gt; to cancel hiding the component. Fires the '{@link #hide}'
  1414. * event after hiding the component. Note this method is called internally if
  1415. * the component is configured to be &lt;code&gt;{@link #hidden}&lt;/code&gt;.
  1416. * @return {Ext.Component} this
  1417. */
  1418. hide : function(){
  1419. if(this.fireEvent('beforehide', this) !== false){
  1420. this.doHide();
  1421. this.fireEvent('hide', this);
  1422. }
  1423. return this;
  1424. },
  1425. // private
  1426. doHide: function(){
  1427. this.hidden = true;
  1428. if(this.rendered){
  1429. this.onHide();
  1430. }
  1431. },
  1432. // private
  1433. onHide : function(){
  1434. this.getVisibilityEl().addClass('x-hide-' + this.hideMode);
  1435. },
  1436. // private
  1437. getVisibilityEl : function(){
  1438. return this.hideParent ? this.container : this.getActionEl();
  1439. },
  1440. <span id='Ext-Component-method-setVisible'> /**
  1441. </span> * Convenience function to hide or show this component by boolean.
  1442. * @param {Boolean} visible True to show, false to hide
  1443. * @return {Ext.Component} this
  1444. */
  1445. setVisible : function(visible){
  1446. return this[visible ? 'show' : 'hide']();
  1447. },
  1448. <span id='Ext-Component-method-isVisible'> /**
  1449. </span> * Returns true if this component is visible.
  1450. * @return {Boolean} True if this component is visible, false otherwise.
  1451. */
  1452. isVisible : function(){
  1453. return this.rendered &amp;&amp; this.getVisibilityEl().isVisible();
  1454. },
  1455. <span id='Ext-Component-method-cloneConfig'> /**
  1456. </span> * Clone the current component using the original config values passed into this instance by default.
  1457. * @param {Object} overrides A new config containing any properties to override in the cloned version.
  1458. * An id property can be passed on this object, otherwise one will be generated to avoid duplicates.
  1459. * @return {Ext.Component} clone The cloned copy of this component
  1460. */
  1461. cloneConfig : function(overrides){
  1462. overrides = overrides || {};
  1463. var id = overrides.id || Ext.id();
  1464. var cfg = Ext.applyIf(overrides, this.initialConfig);
  1465. cfg.id = id; // prevent dup id
  1466. return new this.constructor(cfg);
  1467. },
  1468. <span id='Ext-Component-method-getXType'> /**
  1469. </span> * Gets the xtype for this component as registered with {@link Ext.ComponentMgr}. For a list of all
  1470. * available xtypes, see the {@link Ext.Component} header. Example usage:
  1471. * &lt;pre&gt;&lt;code&gt;
  1472. var t = new Ext.form.TextField();
  1473. alert(t.getXType()); // alerts 'textfield'
  1474. &lt;/code&gt;&lt;/pre&gt;
  1475. * @return {String} The xtype
  1476. */
  1477. getXType : function(){
  1478. return this.constructor.xtype;
  1479. },
  1480. <span id='Ext-Component-method-isXType'> /**
  1481. </span> * &lt;p&gt;Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
  1482. * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).&lt;/p&gt;
  1483. * &lt;p&gt;&lt;b&gt;If using your own subclasses, be aware that a Component must register its own xtype
  1484. * to participate in determination of inherited xtypes.&lt;/b&gt;&lt;/p&gt;
  1485. * &lt;p&gt;For a list of all available xtypes, see the {@link Ext.Component} header.&lt;/p&gt;
  1486. * &lt;p&gt;Example usage:&lt;/p&gt;
  1487. * &lt;pre&gt;&lt;code&gt;
  1488. var t = new Ext.form.TextField();
  1489. var isText = t.isXType('textfield'); // true
  1490. var isBoxSubclass = t.isXType('box'); // true, descended from BoxComponent
  1491. var isBoxInstance = t.isXType('box', true); // false, not a direct BoxComponent instance
  1492. &lt;/code&gt;&lt;/pre&gt;
  1493. * @param {String/Ext.Component/Class} xtype The xtype to check for this Component. Note that the the component can either be an instance
  1494. * or a component class:
  1495. * &lt;pre&gt;&lt;code&gt;
  1496. var c = new Ext.Component();
  1497. console.log(c.isXType(c));
  1498. console.log(c.isXType(Ext.Component));
  1499. &lt;/code&gt;&lt;/pre&gt;
  1500. * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
  1501. * the default), or true to check whether this Component is directly of the specified xtype.
  1502. * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
  1503. */
  1504. isXType : function(xtype, shallow){
  1505. //assume a string by default
  1506. if (Ext.isFunction(xtype)){
  1507. xtype = xtype.xtype; //handle being passed the class, e.g. Ext.Component
  1508. }else if (Ext.isObject(xtype)){
  1509. xtype = xtype.constructor.xtype; //handle being passed an instance
  1510. }
  1511. return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1 : this.constructor.xtype == xtype;
  1512. },
  1513. <span id='Ext-Component-method-getXTypes'> /**
  1514. </span> * &lt;p&gt;Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
  1515. * available xtypes, see the {@link Ext.Component} header.&lt;/p&gt;
  1516. * &lt;p&gt;&lt;b&gt;If using your own subclasses, be aware that a Component must register its own xtype
  1517. * to participate in determination of inherited xtypes.&lt;/b&gt;&lt;/p&gt;
  1518. * &lt;p&gt;Example usage:&lt;/p&gt;
  1519. * &lt;pre&gt;&lt;code&gt;
  1520. var t = new Ext.form.TextField();
  1521. alert(t.getXTypes()); // alerts 'component/box/field/textfield'
  1522. &lt;/code&gt;&lt;/pre&gt;
  1523. * @return {String} The xtype hierarchy string
  1524. */
  1525. getXTypes : function(){
  1526. var tc = this.constructor;
  1527. if(!tc.xtypes){
  1528. var c = [], sc = this;
  1529. while(sc &amp;&amp; sc.constructor.xtype){
  1530. c.unshift(sc.constructor.xtype);
  1531. sc = sc.constructor.superclass;
  1532. }
  1533. tc.xtypeChain = c;
  1534. tc.xtypes = c.join('/');
  1535. }
  1536. return tc.xtypes;
  1537. },
  1538. <span id='Ext-Component-method-findParentBy'> /**
  1539. </span> * Find a container above this component at any level by a custom function. If the passed function returns
  1540. * true, the container will be returned.
  1541. * @param {Function} fn The custom function to call with the arguments (container, this component).
  1542. * @return {Ext.Container} The first Container for which the custom function returns true
  1543. */
  1544. findParentBy : function(fn) {
  1545. for (var p = this.ownerCt; (p != null) &amp;&amp; !fn(p, this); p = p.ownerCt);
  1546. return p || null;
  1547. },
  1548. <span id='Ext-Component-method-findParentByType'> /**
  1549. </span> * Find a container above this component at any level by xtype or class
  1550. * @param {String/Ext.Component/Class} xtype The xtype to check for this Component. Note that the the component can either be an instance
  1551. * or a component class:
  1552. * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
  1553. * the default), or true to check whether this Component is directly of the specified xtype.
  1554. * @return {Ext.Container} The first Container which matches the given xtype or class
  1555. */
  1556. findParentByType : function(xtype, shallow){
  1557. return this.findParentBy(function(c){
  1558. return c.isXType(xtype, shallow);
  1559. });
  1560. },
  1561. <span id='Ext-Component-method-bubble'> /**
  1562. </span> * Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (&lt;i&gt;this&lt;/i&gt;) of
  1563. * function call will be the scope provided or the current component. The arguments to the function
  1564. * will be the args provided or the current component. If the function returns false at any point,
  1565. * the bubble is stopped.
  1566. * @param {Function} fn The function to call
  1567. * @param {Object} scope (optional) The scope of the function (defaults to current node)
  1568. * @param {Array} args (optional) The args to call the function with (default to passing the current component)
  1569. * @return {Ext.Component} this
  1570. */
  1571. bubble : function(fn, scope, args){
  1572. var p = this;
  1573. while(p){
  1574. if(fn.apply(scope || p, args || [p]) === false){
  1575. break;
  1576. }
  1577. p = p.ownerCt;
  1578. }
  1579. return this;
  1580. },
  1581. // protected
  1582. getPositionEl : function(){
  1583. return this.positionEl || this.el;
  1584. },
  1585. // private
  1586. purgeListeners : function(){
  1587. Ext.Component.superclass.purgeListeners.call(this);
  1588. if(this.mons){
  1589. this.on('beforedestroy', this.clearMons, this, {single: true});
  1590. }
  1591. },
  1592. // private
  1593. clearMons : function(){
  1594. Ext.each(this.mons, function(m){
  1595. m.item.un(m.ename, m.fn, m.scope);
  1596. }, this);
  1597. this.mons = [];
  1598. },
  1599. // private
  1600. createMons: function(){
  1601. if(!this.mons){
  1602. this.mons = [];
  1603. this.on('beforedestroy', this.clearMons, this, {single: true});
  1604. }
  1605. },
  1606. <span id='Ext-Component-method-mon'> /**
  1607. </span> * &lt;p&gt;Adds listeners to any Observable object (or Elements) which are automatically removed when this Component
  1608. * is destroyed. Usage:&lt;/p&gt;&lt;code&gt;&lt;pre&gt;
  1609. myGridPanel.mon(myGridPanel.getSelectionModel(), 'selectionchange', handleSelectionChange, null, {buffer: 50});
  1610. &lt;/pre&gt;&lt;/code&gt;
  1611. * &lt;p&gt;or:&lt;/p&gt;&lt;code&gt;&lt;pre&gt;
  1612. myGridPanel.mon(myGridPanel.getSelectionModel(), {
  1613. selectionchange: handleSelectionChange,
  1614. buffer: 50
  1615. });
  1616. &lt;/pre&gt;&lt;/code&gt;
  1617. * @param {Observable|Element} item The item to which to add a listener/listeners.
  1618. * @param {Object|String} ename The event name, or an object containing event name properties.
  1619. * @param {Function} fn Optional. If the &lt;code&gt;ename&lt;/code&gt; parameter was an event name, this
  1620. * is the handler function.
  1621. * @param {Object} scope Optional. If the &lt;code&gt;ename&lt;/code&gt; parameter was an event name, this
  1622. * is the scope (&lt;code&gt;this&lt;/code&gt; reference) in which the handler function is executed.
  1623. * @param {Object} opt Optional. If the &lt;code&gt;ename&lt;/code&gt; parameter was an event name, this
  1624. * is the {@link Ext.util.Observable#addListener addListener} options.
  1625. */
  1626. mon : function(item, ename, fn, scope, opt){
  1627. this.createMons();
  1628. if(Ext.isObject(ename)){
  1629. var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
  1630. var o = ename;
  1631. for(var e in o){
  1632. if(propRe.test(e)){
  1633. continue;
  1634. }
  1635. if(Ext.isFunction(o[e])){
  1636. // shared options
  1637. this.mons.push({
  1638. item: item, ename: e, fn: o[e], scope: o.scope
  1639. });
  1640. item.on(e, o[e], o.scope, o);
  1641. }else{
  1642. // individual options
  1643. this.mons.push({
  1644. item: item, ename: e, fn: o[e], scope: o.scope
  1645. });
  1646. item.on(e, o[e]);
  1647. }
  1648. }
  1649. return;
  1650. }
  1651. this.mons.push({
  1652. item: item, ename: ename, fn: fn, scope: scope
  1653. });
  1654. item.on(ename, fn, scope, opt);
  1655. },
  1656. <span id='Ext-Component-method-mun'> /**
  1657. </span> * Removes listeners that were added by the {@link #mon} method.
  1658. * @param {Observable|Element} item The item from which to remove a listener/listeners.
  1659. * @param {Object|String} ename The event name, or an object containing event name properties.
  1660. * @param {Function} fn Optional. If the &lt;code&gt;ename&lt;/code&gt; parameter was an event name, this
  1661. * is the handler function.
  1662. * @param {Object} scope Optional. If the &lt;code&gt;ename&lt;/code&gt; parameter was an event name, this
  1663. * is the scope (&lt;code&gt;this&lt;/code&gt; reference) in which the handler function is executed.
  1664. */
  1665. mun : function(item, ename, fn, scope){
  1666. var found, mon;
  1667. this.createMons();
  1668. for(var i = 0, len = this.mons.length; i &lt; len; ++i){
  1669. mon = this.mons[i];
  1670. if(item === mon.item &amp;&amp; ename == mon.ename &amp;&amp; fn === mon.fn &amp;&amp; scope === mon.scope){
  1671. this.mons.splice(i, 1);
  1672. item.un(ename, fn, scope);
  1673. found = true;
  1674. break;
  1675. }
  1676. }
  1677. return found;
  1678. },
  1679. <span id='Ext-Component-method-nextSibling'> /**
  1680. </span> * Returns the next component in the owning container
  1681. * @return Ext.Component
  1682. */
  1683. nextSibling : function(){
  1684. if(this.ownerCt){
  1685. var index = this.ownerCt.items.indexOf(this);
  1686. if(index != -1 &amp;&amp; index+1 &lt; this.ownerCt.items.getCount()){
  1687. return this.ownerCt.items.itemAt(index+1);
  1688. }
  1689. }
  1690. return null;
  1691. },
  1692. <span id='Ext-Component-method-previousSibling'> /**
  1693. </span> * Returns the previous component in the owning container
  1694. * @return Ext.Component
  1695. */
  1696. previousSibling : function(){
  1697. if(this.ownerCt){
  1698. var index = this.ownerCt.items.indexOf(this);
  1699. if(index &gt; 0){
  1700. return this.ownerCt.items.itemAt(index-1);
  1701. }
  1702. }
  1703. return null;
  1704. },
  1705. <span id='Ext-Component-method-getBubbleTarget'> /**
  1706. </span> * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
  1707. * @return {Ext.Container} the Container which owns this Component.
  1708. */
  1709. getBubbleTarget : function(){
  1710. return this.ownerCt;
  1711. }
  1712. });
  1713. Ext.reg('component', Ext.Component);
  1714. </pre>
  1715. </body>
  1716. </html>