4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-AbstractComponent-method-constructor'><span id='Ext-AbstractComponent'>/**
19 </span></span> * @class Ext.AbstractComponent
20 * <p>An abstract base class which provides shared methods for Components across the Sencha product line.</p>
21 * <p>Please refer to sub class's documentation</p>
25 Ext.define('Ext.AbstractComponent', {
27 /* Begin Definitions */
30 observable: 'Ext.util.Observable',
31 animate: 'Ext.util.Animate',
32 state: 'Ext.state.Stateful'
37 'Ext.ComponentManager',
43 'Ext.ComponentLoader',
46 'Ext.layout.component.Auto'
49 // Please remember to add dependencies whenever you use it
50 // I had to fix these many times already
63 getAutoId: function() {
64 return ++Ext.AbstractComponent.AUTO_ID;
67 <span id='Ext-AbstractComponent-cfg-id'> /**
68 </span> * @cfg {String} id
69 * <p>The <b><u>unique id of this component instance</u></b> (defaults to an {@link #getId auto-assigned id}).</p>
70 * <p>It should not be necessary to use this configuration except for singleton objects in your application.
71 * Components created with an id may be accessed globally using {@link Ext#getCmp Ext.getCmp}.</p>
72 * <p>Instead of using assigned ids, use the {@link #itemId} config, and {@link Ext.ComponentQuery ComponentQuery} which
73 * provides selector-based searching for Sencha Components analogous to DOM querying. The {@link Ext.container.Container Container}
74 * class contains {@link Ext.container.Container#down shortcut methods} to query its descendant Components by selector.</p>
75 * <p>Note that this id will also be used as the element id for the containing HTML element
76 * that is rendered to the page for this component. This allows you to write id-based CSS
77 * rules to style the specific instance of this component uniquely, and also to select
78 * sub-elements using this component's id as the parent.</p>
79 * <p><b>Note</b>: to avoid complications imposed by a unique <tt>id</tt> also see <code>{@link #itemId}</code>.</p>
80 * <p><b>Note</b>: to access the container of a Component see <code>{@link #ownerCt}</code>.</p>
83 <span id='Ext-AbstractComponent-cfg-itemId'> /**
84 </span> * @cfg {String} itemId
85 * <p>An <tt>itemId</tt> can be used as an alternative way to get a reference to a component
86 * when no object reference is available. Instead of using an <code>{@link #id}</code> with
87 * {@link Ext}.{@link Ext#getCmp getCmp}, use <code>itemId</code> with
88 * {@link Ext.container.Container}.{@link Ext.container.Container#getComponent getComponent} which will retrieve
89 * <code>itemId</code>'s or <tt>{@link #id}</tt>'s. Since <code>itemId</code>'s are an index to the
90 * container's internal MixedCollection, the <code>itemId</code> is scoped locally to the container --
91 * avoiding potential conflicts with {@link Ext.ComponentManager} which requires a <b>unique</b>
92 * <code>{@link #id}</code>.</p>
93 * <pre><code>
94 var c = new Ext.panel.Panel({ //
95 {@link Ext.Component#height height}: 300,
96 {@link #renderTo}: document.body,
97 {@link Ext.container.Container#layout layout}: 'auto',
98 {@link Ext.container.Container#items items}: [
101 {@link Ext.panel.Panel#title title}: 'Panel 1',
102 {@link Ext.Component#height height}: 150
106 {@link Ext.panel.Panel#title title}: 'Panel 2',
107 {@link Ext.Component#height height}: 150
111 p1 = c.{@link Ext.container.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
112 p2 = p1.{@link #ownerCt}.{@link Ext.container.Container#getComponent getComponent}('p2'); // reference via a sibling
113 * </code></pre>
114 * <p>Also see <tt>{@link #id}</tt>, <code>{@link #query}</code>, <code>{@link #down}</code> and <code>{@link #child}</code>.</p>
115 * <p><b>Note</b>: to access the container of an item see <tt>{@link #ownerCt}</tt>.</p>
118 <span id='Ext-AbstractComponent-property-ownerCt'> /**
119 </span> * This Component's owner {@link Ext.container.Container Container} (defaults to undefined, and is set automatically when
120 * this Component is added to a Container). Read-only.
121 * <p><b>Note</b>: to access items within the Container see <tt>{@link #itemId}</tt>.</p>
122 * @type Ext.Container
126 <span id='Ext-AbstractComponent-cfg-autoEl'> /**
127 </span> * @cfg {Mixed} autoEl
128 * <p>A tag name or {@link Ext.core.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
129 * encapsulate this Component.</p>
130 * <p>You do not normally need to specify this. For the base classes {@link Ext.Component} and {@link Ext.container.Container},
131 * this defaults to <b><tt>'div'</tt></b>. The more complex Sencha classes use a more complex
132 * DOM structure specified by their own {@link #renderTpl}s.</p>
133 * <p>This is intended to allow the developer to create application-specific utility Components encapsulated by
134 * different DOM elements. Example usage:</p><pre><code>
139 src: 'http://www.example.com/example.jpg'
145 html: 'autoEl is cool!'
150 cls: 'ux-unordered-list',
154 html: 'First list item'
157 </code></pre>
160 <span id='Ext-AbstractComponent-cfg-renderTpl'> /**
161 </span> * @cfg {Mixed} renderTpl
162 * <p>An {@link Ext.XTemplate XTemplate} used to create the internal structure inside this Component's
163 * encapsulating {@link #getEl Element}.</p>
164 * <p>You do not normally need to specify this. For the base classes {@link Ext.Component}
165 * and {@link Ext.container.Container}, this defaults to <b><code>null</code></b> which means that they will be initially rendered
166 * with no internal structure; they render their {@link #getEl Element} empty. The more specialized ExtJS and Touch classes
167 * which use a more complex DOM structure, provide their own template definitions.</p>
168 * <p>This is intended to allow the developer to create application-specific utility Components with customized
169 * internal structure.</p>
170 * <p>Upon rendering, any created child elements may be automatically imported into object properties using the
171 * {@link #renderSelectors} option.</p>
175 <span id='Ext-AbstractComponent-cfg-renderSelectors'> /**
176 </span> * @cfg {Object} renderSelectors
178 An object containing properties specifying {@link Ext.DomQuery DomQuery} selectors which identify child elements
179 created by the render process.
181 After the Component's internal structure is rendered according to the {@link #renderTpl}, this object is iterated through,
182 and the found Elements are added as properties to the Component using the `renderSelector` property name.
184 For example, a Component which rendered an image, and description into its element might use the following properties
185 coded into its prototype:
187 renderTpl: '&lt;img src="{imageUrl}" class="x-image-component-img">&lt;div class="x-image-component-desc">{description}&gt;/div&lt;',
190 image: 'img.x-image-component-img',
191 descEl: 'div.x-image-component-desc'
194 After rendering, the Component would have a property <code>image</code> referencing its child `img` Element,
195 and a property `descEl` referencing the `div` Element which contains the description.
200 <span id='Ext-AbstractComponent-cfg-renderTo'> /**
201 </span> * @cfg {Mixed} renderTo
202 * <p>Specify the id of the element, a DOM element or an existing Element that this component
203 * will be rendered into.</p><div><ul>
204 * <li><b>Notes</b> : <ul>
205 * <div class="sub-desc">Do <u>not</u> use this option if the Component is to be a child item of
206 * a {@link Ext.container.Container Container}. It is the responsibility of the
207 * {@link Ext.container.Container Container}'s {@link Ext.container.Container#layout layout manager}
208 * to render and manage its child items.</div>
209 * <div class="sub-desc">When using this config, a call to render() is not required.</div>
210 * </ul></li>
211 * </ul></div>
212 * <p>See <code>{@link #render}</code> also.</p>
215 <span id='Ext-AbstractComponent-cfg-frame'> /**
216 </span> * @cfg {Boolean} frame
217 * <p>Specify as <code>true</code> to have the Component inject framing elements within the Component at render time to
218 * provide a graphical rounded frame around the Component content.</p>
219 * <p>This is only necessary when running on outdated, or non standard-compliant browsers such as Microsoft's Internet Explorer
220 * prior to version 9 which do not support rounded corners natively.</p>
221 * <p>The extra space taken up by this framing is available from the read only property {@link #frameSize}.</p>
224 <span id='Ext-AbstractComponent-property-frameSize'> /**
225 </span> * <p>Read-only property indicating the width of any framing elements which were added within the encapsulating element
226 * to provide graphical, rounded borders. See the {@link #frame} config.</p>
227 * <p> This is an object containing the frame width in pixels for all four sides of the Component containing
228 * the following properties:</p><div class="mdetail-params"><ul>
229 * <li><code>top</code> The width of the top framing element in pixels.</li>
230 * <li><code>right</code> The width of the right framing element in pixels.</li>
231 * <li><code>bottom</code> The width of the bottom framing element in pixels.</li>
232 * <li><code>left</code> The width of the left framing element in pixels.</li>
233 * </ul></div>
234 * @property frameSize
238 <span id='Ext-AbstractComponent-cfg-componentLayout'> /**
239 </span> * @cfg {String/Object} componentLayout
240 * <p>The sizing and positioning of a Component's internal Elements is the responsibility of
241 * the Component's layout manager which sizes a Component's internal structure in response to the Component being sized.</p>
242 * <p>Generally, developers will not use this configuration as all provided Components which need their internal
243 * elements sizing (Such as {@link Ext.form.field.Base input fields}) come with their own componentLayout managers.</p>
244 * <p>The {@link Ext.layout.container.Auto default layout manager} will be used on instances of the base Ext.Component class
245 * which simply sizes the Component's encapsulating element to the height and width specified in the {@link #setSize} method.</p>
248 <span id='Ext-AbstractComponent-cfg-tpl'> /**
249 </span> * @cfg {Mixed} tpl
250 * An <bold>{@link Ext.Template}</bold>, <bold>{@link Ext.XTemplate}</bold>
251 * or an array of strings to form an Ext.XTemplate.
252 * Used in conjunction with the <code>{@link #data}</code> and
253 * <code>{@link #tplWriteMode}</code> configurations.
256 <span id='Ext-AbstractComponent-cfg-data'> /**
257 </span> * @cfg {Mixed} data
258 * The initial set of data to apply to the <code>{@link #tpl}</code> to
259 * update the content area of the Component.
262 <span id='Ext-AbstractComponent-cfg-tplWriteMode'> /**
263 </span> * @cfg {String} tplWriteMode The Ext.(X)Template method to use when
264 * updating the content area of the Component. Defaults to <code>'overwrite'</code>
265 * (see <code>{@link Ext.XTemplate#overwrite}</code>).
267 tplWriteMode: 'overwrite',
269 <span id='Ext-AbstractComponent-cfg-baseCls'> /**
270 </span> * @cfg {String} baseCls
271 * The base CSS class to apply to this components's element. This will also be prepended to
272 * elements within this component like Panel's body will get a class x-panel-body. This means
273 * that if you create a subclass of Panel, and you want it to get all the Panels styling for the
274 * element and the body, you leave the baseCls x-panel and use componentCls to add specific styling for this
277 baseCls: Ext.baseCSSPrefix + 'component',
279 <span id='Ext-AbstractComponent-cfg-componentCls'> /**
280 </span> * @cfg {String} componentCls
281 * CSS Class to be added to a components root level element to give distinction to it
285 <span id='Ext-AbstractComponent-cfg-cls'> /**
286 </span> * @cfg {String} cls
287 * An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be
288 * useful for adding customized styles to the component or any of its children using standard CSS rules.
291 <span id='Ext-AbstractComponent-cfg-overCls'> /**
292 </span> * @cfg {String} overCls
293 * An optional extra CSS class that will be added to this component's Element when the mouse moves
294 * over the Element, and removed when the mouse moves out. (defaults to ''). This can be
295 * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
298 <span id='Ext-AbstractComponent-cfg-disabledCls'> /**
299 </span> * @cfg {String} disabledCls
300 * CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
302 disabledCls: Ext.baseCSSPrefix + 'item-disabled',
304 <span id='Ext-AbstractComponent-cfg-ui'> /**
305 </span> * @cfg {String/Array} ui
306 * A set style for a component. Can be a string or an Array of multiple strings (UIs)
310 <span id='Ext-AbstractComponent-cfg-uiCls'> /**
311 </span> * @cfg {Array} uiCls
312 * An array of of classNames which are currently applied to this component
317 <span id='Ext-AbstractComponent-cfg-style'> /**
318 </span> * @cfg {String} style
319 * A custom style specification to be applied to this component's Element. Should be a valid argument to
320 * {@link Ext.core.Element#applyStyles}.
321 * <pre><code>
322 new Ext.panel.Panel({
324 renderTo: Ext.getBody(),
325 width: 400, height: 300,
334 new Ext.button.Button({
343 </code></pre>
346 <span id='Ext-AbstractComponent-cfg-width'> /**
347 </span> * @cfg {Number} width
348 * The width of this component in pixels.
351 <span id='Ext-AbstractComponent-cfg-height'> /**
352 </span> * @cfg {Number} height
353 * The height of this component in pixels.
356 <span id='Ext-AbstractComponent-cfg-border'> /**
357 </span> * @cfg {Number/String} border
358 * Specifies the border for this component. The border can be a single numeric value to apply to all sides or
359 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
362 <span id='Ext-AbstractComponent-cfg-padding'> /**
363 </span> * @cfg {Number/String} padding
364 * Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or
365 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
368 <span id='Ext-AbstractComponent-cfg-margin'> /**
369 </span> * @cfg {Number/String} margin
370 * Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or
371 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
374 <span id='Ext-AbstractComponent-cfg-hidden'> /**
375 </span> * @cfg {Boolean} hidden
380 <span id='Ext-AbstractComponent-cfg-disabled'> /**
381 </span> * @cfg {Boolean} disabled
386 <span id='Ext-AbstractComponent-cfg-draggable'> /**
387 </span> * @cfg {Boolean} draggable
388 * Allows the component to be dragged.
391 <span id='Ext-AbstractComponent-property-draggable'> /**
392 </span> * Read-only property indicating whether or not the component can be dragged
393 * @property draggable
398 <span id='Ext-AbstractComponent-cfg-floating'> /**
399 </span> * @cfg {Boolean} floating
400 * Create the Component as a floating and use absolute positioning.
405 <span id='Ext-AbstractComponent-cfg-hideMode'> /**
406 </span> * @cfg {String} hideMode
407 * A String which specifies how this Component's encapsulating DOM element will be hidden.
408 * Values may be<div class="mdetail-params"><ul>
409 * <li><code>'display'</code> : The Component will be hidden using the <code>display: none</code> style.</li>
410 * <li><code>'visibility'</code> : The Component will be hidden using the <code>visibility: hidden</code> style.</li>
411 * <li><code>'offsets'</code> : The Component will be hidden by absolutely positioning it out of the visible area of the document. This
412 * is useful when a hidden Component must maintain measurable dimensions. Hiding using <code>display</code> results
413 * in a Component having zero dimensions.</li></ul></div>
414 * Defaults to <code>'display'</code>.
418 <span id='Ext-AbstractComponent-cfg-contentEl'> /**
419 </span> * @cfg {String} contentEl
420 * <p>Optional. Specify an existing HTML element, or the <code>id</code> of an existing HTML element to use as the content
421 * for this component.</p>
423 * <li><b>Description</b> :
424 * <div class="sub-desc">This config option is used to take an existing HTML element and place it in the layout element
425 * of a new component (it simply moves the specified DOM element <i>after the Component is rendered</i> to use as the content.</div></li>
426 * <li><b>Notes</b> :
427 * <div class="sub-desc">The specified HTML element is appended to the layout element of the component <i>after any configured
428 * {@link #html HTML} has been inserted</i>, and so the document will not contain this element at the time the {@link #render} event is fired.</div>
429 * <div class="sub-desc">The specified HTML element used will not participate in any <code><b>{@link Ext.container.Container#layout layout}</b></code>
430 * scheme that the Component may use. It is just HTML. Layouts operate on child <code><b>{@link Ext.container.Container#items items}</b></code>.</div>
431 * <div class="sub-desc">Add either the <code>x-hidden</code> or the <code>x-hide-display</code> CSS class to
432 * prevent a brief flicker of the content before it is rendered to the panel.</div></li>
436 <span id='Ext-AbstractComponent-cfg-html'> /**
437 </span> * @cfg {String/Object} html
438 * An HTML fragment, or a {@link Ext.core.DomHelper DomHelper} specification to use as the layout element
439 * content (defaults to ''). The HTML content is added after the component is rendered,
440 * so the document will not contain this HTML at the time the {@link #render} event is fired.
441 * This content is inserted into the body <i>before</i> any configured {@link #contentEl} is appended.
444 <span id='Ext-AbstractComponent-cfg-styleHtmlContent'> /**
445 </span> * @cfg {Boolean} styleHtmlContent
446 * True to automatically style the html inside the content target of this component (body for panels).
449 styleHtmlContent: false,
451 <span id='Ext-AbstractComponent-cfg-styleHtmlCls'> /**
452 </span> * @cfg {String} styleHtmlCls
453 * The class that is added to the content target when you set styleHtmlContent to true.
454 * Defaults to 'x-html'
456 styleHtmlCls: Ext.baseCSSPrefix + 'html',
458 <span id='Ext-AbstractComponent-cfg-minHeight'> /**
459 </span> * @cfg {Number} minHeight
460 * <p>The minimum value in pixels which this Component will set its height to.</p>
461 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
463 <span id='Ext-AbstractComponent-cfg-minWidth'> /**
464 </span> * @cfg {Number} minWidth
465 * <p>The minimum value in pixels which this Component will set its width to.</p>
466 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
468 <span id='Ext-AbstractComponent-cfg-maxHeight'> /**
469 </span> * @cfg {Number} maxHeight
470 * <p>The maximum value in pixels which this Component will set its height to.</p>
471 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
473 <span id='Ext-AbstractComponent-cfg-maxWidth'> /**
474 </span> * @cfg {Number} maxWidth
475 * <p>The maximum value in pixels which this Component will set its width to.</p>
476 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
479 <span id='Ext-AbstractComponent-cfg-loader'> /**
480 </span> * @cfg {Ext.ComponentLoader/Object} loader
481 * A configuration object or an instance of a {@link Ext.ComponentLoader} to load remote
482 * content for this Component.
488 <span id='Ext-AbstractComponent-cfg-autoShow'> /**
489 </span> * @cfg {Boolean} autoShow True to automatically show the component upon creation.
490 * This config option may only be used for {@link #floating} components or components
491 * that use {@link #autoRender}. Defaults to <tt>false</tt>.
495 <span id='Ext-AbstractComponent-cfg-autoRender'> /**
496 </span> * @cfg {Mixed} autoRender
497 * <p>This config is intended mainly for {@link #floating} Components which may or may not be shown. Instead
498 * of using {@link #renderTo} in the configuration, and rendering upon construction, this allows a Component
499 * to render itself upon first <i>{@link #show}</i>.</p>
500 * <p>Specify as <code>true</code> to have this Component render to the document body upon first show.</p>
501 * <p>Specify as an element, or the ID of an element to have this Component render to a specific element upon first show.</p>
502 * <p><b>This defaults to <code>true</code> for the {@link Ext.window.Window Window} class.</b></p>
508 <span id='Ext-AbstractComponent-cfg-plugins'> /**
509 </span> * @cfg {Object/Array} plugins
510 * An object or array of objects that will provide custom functionality for this component. The only
511 * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component.
512 * When a component is created, if any plugins are available, the component will call the init method on each
513 * plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the
514 * component as needed to provide its functionality.
517 <span id='Ext-AbstractComponent-property-rendered'> /**
518 </span> * Read-only property indicating whether or not the component has been rendered.
526 trimRe: /^\s+|\s+$/g,
530 <span id='Ext-AbstractComponent-property-maskOnDisable'> /**
531 </span> * This is an internal flag that you use when creating custom components.
532 * By default this is set to true which means that every component gets a mask when its disabled.
533 * Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false
534 * since they want to implement custom disable logic.
535 * @property maskOnDisable
540 constructor : function(config) {
544 config = config || {};
545 me.initialConfig = config;
546 Ext.apply(me, config);
549 <span id='Ext-AbstractComponent-event-beforeactivate'> /**
550 </span> * @event beforeactivate
551 * Fires before a Component has been visually activated.
552 * Returning false from an event listener can prevent the activate
554 * @param {Ext.Component} this
557 <span id='Ext-AbstractComponent-event-activate'> /**
558 </span> * @event activate
559 * Fires after a Component has been visually activated.
560 * @param {Ext.Component} this
563 <span id='Ext-AbstractComponent-event-beforedeactivate'> /**
564 </span> * @event beforedeactivate
565 * Fires before a Component has been visually deactivated.
566 * Returning false from an event listener can prevent the deactivate
568 * @param {Ext.Component} this
571 <span id='Ext-AbstractComponent-event-deactivate'> /**
572 </span> * @event deactivate
573 * Fires after a Component has been visually deactivated.
574 * @param {Ext.Component} this
577 <span id='Ext-AbstractComponent-event-added'> /**
578 </span> * @event added
579 * Fires after a Component had been added to a Container.
580 * @param {Ext.Component} this
581 * @param {Ext.container.Container} container Parent Container
582 * @param {Number} pos position of Component
585 <span id='Ext-AbstractComponent-event-disable'> /**
586 </span> * @event disable
587 * Fires after the component is disabled.
588 * @param {Ext.Component} this
591 <span id='Ext-AbstractComponent-event-enable'> /**
592 </span> * @event enable
593 * Fires after the component is enabled.
594 * @param {Ext.Component} this
597 <span id='Ext-AbstractComponent-event-beforeshow'> /**
598 </span> * @event beforeshow
599 * Fires before the component is shown when calling the {@link #show} method.
600 * Return false from an event handler to stop the show.
601 * @param {Ext.Component} this
604 <span id='Ext-AbstractComponent-event-show'> /**
605 </span> * @event show
606 * Fires after the component is shown when calling the {@link #show} method.
607 * @param {Ext.Component} this
610 <span id='Ext-AbstractComponent-event-beforehide'> /**
611 </span> * @event beforehide
612 * Fires before the component is hidden when calling the {@link #hide} method.
613 * Return false from an event handler to stop the hide.
614 * @param {Ext.Component} this
617 <span id='Ext-AbstractComponent-event-hide'> /**
618 </span> * @event hide
619 * Fires after the component is hidden.
620 * Fires after the component is hidden when calling the {@link #hide} method.
621 * @param {Ext.Component} this
624 <span id='Ext-AbstractComponent-event-removed'> /**
625 </span> * @event removed
626 * Fires when a component is removed from an Ext.container.Container
627 * @param {Ext.Component} this
628 * @param {Ext.container.Container} ownerCt Container which holds the component
631 <span id='Ext-AbstractComponent-event-beforerender'> /**
632 </span> * @event beforerender
633 * Fires before the component is {@link #rendered}. Return false from an
634 * event handler to stop the {@link #render}.
635 * @param {Ext.Component} this
638 <span id='Ext-AbstractComponent-event-render'> /**
639 </span> * @event render
640 * Fires after the component markup is {@link #rendered}.
641 * @param {Ext.Component} this
644 <span id='Ext-AbstractComponent-event-afterrender'> /**
645 </span> * @event afterrender
646 * <p>Fires after the component rendering is finished.</p>
647 * <p>The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed
648 * by any afterRender method defined for the Component.</p>
649 * @param {Ext.Component} this
652 <span id='Ext-AbstractComponent-event-beforedestroy'> /**
653 </span> * @event beforedestroy
654 * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}.
655 * @param {Ext.Component} this
658 <span id='Ext-AbstractComponent-event-destroy'> /**
659 </span> * @event destroy
660 * Fires after the component is {@link #destroy}ed.
661 * @param {Ext.Component} this
664 <span id='Ext-AbstractComponent-event-resize'> /**
665 </span> * @event resize
666 * Fires after the component is resized.
667 * @param {Ext.Component} this
668 * @param {Number} adjWidth The box-adjusted width that was set
669 * @param {Number} adjHeight The box-adjusted height that was set
672 <span id='Ext-AbstractComponent-event-move'> /**
673 </span> * @event move
674 * Fires after the component is moved.
675 * @param {Ext.Component} this
676 * @param {Number} x The new x position
677 * @param {Number} y The new y position
685 me.additionalCls = [];
686 me.renderData = me.renderData || {};
687 me.renderSelectors = me.renderSelectors || {};
690 me.plugins = [].concat(me.plugins);
691 for (i = 0, len = me.plugins.length; i < len; i++) {
692 me.plugins[i] = me.constructPlugin(me.plugins[i]);
698 // ititComponent gets a chance to change the id property before registering
699 Ext.ComponentManager.register(me);
701 // Dont pass the config so that it is not applied to 'this' again
702 me.mixins.observable.constructor.call(me);
703 me.mixins.state.constructor.call(me, config);
705 // Move this into Observable?
707 me.plugins = [].concat(me.plugins);
708 for (i = 0, len = me.plugins.length; i < len; i++) {
709 me.plugins[i] = me.initPlugin(me.plugins[i]);
713 me.loader = me.getLoader();
716 me.render(me.renderTo);
717 // EXTJSIV-1935 - should be a way to do afterShow or something, but that
718 // won't work. Likewise, rendering hidden and then showing (w/autoShow) has
719 // implications to afterRender so we cannot do that.
727 if (Ext.isDefined(me.disabledClass)) {
728 if (Ext.isDefined(Ext.global.console)) {
729 Ext.global.console.warn('Ext.Component: disabledClass has been deprecated. Please use disabledCls.');
731 me.disabledCls = me.disabledClass;
732 delete me.disabledClass;
737 initComponent: Ext.emptyFn,
741 animate: function(animObj) {
745 animObj = animObj || {};
746 to = animObj.to || {};
748 if (Ext.fx.Manager.hasFxBlock(me.id)) {
751 // Special processing for animating Component dimensions.
752 if (!animObj.dynamic && (to.height || to.width)) {
753 var curWidth = me.getWidth(),
755 curHeight = me.getHeight(),
759 if (to.height && to.height > curHeight) {
763 if (to.width && to.width > curWidth) {
768 // If any dimensions are being increased, we must resize the internal structure
769 // of the Component, but then clip it by sizing its encapsulating element back to original dimensions.
770 // The animation will then progressively reveal the larger content.
772 var clearWidth = !Ext.isNumber(me.width),
773 clearHeight = !Ext.isNumber(me.height);
775 me.componentLayout.childrenChanged = true;
776 me.setSize(w, h, me.ownerCt);
777 me.el.setSize(curWidth, curHeight);
786 return me.mixins.animate.animate.apply(me, arguments);
789 <span id='Ext-AbstractComponent-method-findLayoutController'> /**
790 </span> * <p>This method finds the topmost active layout who's processing will eventually determine the size and position of this
791 * Component.<p>
792 * <p>This method is useful when dynamically adding Components into Containers, and some processing must take place after the
793 * final sizing and positioning of the Component has been performed.</p>
796 findLayoutController: function() {
797 return this.findParentBy(function(c) {
798 // Return true if we are at the root of the Container tree
799 // or this Container's layout is busy but the next one up is not.
800 return !c.ownerCt || (c.layout.layoutBusy && !c.ownerCt.layout.layoutBusy);
804 onShow : function() {
806 var needsLayout = this.needsLayout;
807 if (Ext.isObject(needsLayout)) {
808 this.doComponentLayout(needsLayout.width, needsLayout.height, needsLayout.isSetSize, needsLayout.ownerCt);
812 constructPlugin: function(plugin) {
813 if (plugin.ptype && typeof plugin.init != 'function') {
815 plugin = Ext.PluginManager.create(plugin);
817 else if (typeof plugin == 'string') {
818 plugin = Ext.PluginManager.create({
827 initPlugin : function(plugin) {
833 <span id='Ext-AbstractComponent-method-doAutoRender'> /**
834 </span> * Handles autoRender.
835 * Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that
836 * ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body
838 doAutoRender: function() {
841 me.render(document.body);
843 me.render(Ext.isBoolean(me.autoRender) ? Ext.getBody() : me.autoRender);
848 render : function(container, position) {
851 if (!me.rendered && me.fireEvent('beforerender', me) !== false) {
852 // If this.el is defined, we want to make sure we are dealing with
855 me.el = Ext.get(me.el);
858 // Perform render-time processing for floating Components
863 container = me.initContainer(container);
865 me.onRender(container, position);
867 // Tell the encapsulating element to hide itself in the way the Component is configured to hide
868 // This means DISPLAY, VISIBILITY or OFFSETS.
869 me.el.setVisibilityMode(Ext.core.Element[me.hideMode.toUpperCase()]);
872 me.el.hover(me.addOverCls, me.removeOverCls, me);
875 me.fireEvent('render', me);
879 me.afterRender(container);
880 me.fireEvent('afterrender', me);
885 // Hiding during the render process should not perform any ancillary
886 // actions that the full hide process does; It is not hiding, it begins in a hidden state.'
887 // So just make the element hidden according to the configured hideMode
892 // pass silent so the event doesn't fire the first time.
900 onRender : function(container, position) {
904 styles = me.initStyles(),
905 renderTpl, renderData, i;
907 position = me.getInsertPosition(position);
911 el = Ext.core.DomHelper.insertBefore(position, me.getElConfig(), true);
914 el = Ext.core.DomHelper.append(container, me.getElConfig(), true);
917 else if (me.allowDomMove !== false) {
919 container.dom.insertBefore(el.dom, position);
921 container.dom.appendChild(el.dom);
925 if (Ext.scopeResetCSS && !me.ownerCt) {
926 // If this component's el is the body element, we add the reset class to the html tag
927 if (el.dom == Ext.getBody().dom) {
928 el.parent().addCls(Ext.baseCSSPrefix + 'reset');
931 // Else we wrap this element in an element that adds the reset class.
932 me.resetEl = el.wrap({
933 cls: Ext.baseCSSPrefix + 'reset'
941 // Here we check if the component has a height set through style or css.
942 // If it does then we set the this.height to that value and it won't be
943 // considered an auto height component
944 // if (this.height === undefined) {
945 // var height = el.getHeight();
946 // // This hopefully means that the panel has an explicit height set in style or css
947 // if (height - el.getPadding('tb') - el.getBorderWidth('tb') > 0) {
948 // this.height = height;
955 me.addUIToElement(true);
956 //loop through all exisiting uiCls and update the ui in them
957 for (i = 0; i < me.uiCls.length; i++) {
958 me.addUIClsToElement(me.uiCls[i], true);
963 renderTpl = me.initRenderTpl();
965 renderData = me.initRenderData();
966 renderTpl.append(me.getTargetEl(), renderData);
969 me.applyRenderSelectors();
977 afterRender : function() {
982 me.getComponentLayout();
984 // Set the size if a size is configured, or if this is the outermost Container
985 if (!me.ownerCt || (me.height || me.width)) {
986 me.setSize(me.width, me.height);
989 // For floaters, calculate x and y if they aren't defined by aligning
990 // the sized element to the center of either the the container or the ownerCt
991 if (me.floating && (me.x === undefined || me.y === undefined)) {
992 if (me.floatParent) {
993 xy = me.el.getAlignToXY(me.floatParent.getTargetEl(), 'c-c');
994 pos = me.floatParent.getTargetEl().translatePoints(xy[0], xy[1]);
996 xy = me.el.getAlignToXY(me.container, 'c-c');
997 pos = me.container.translatePoints(xy[0], xy[1]);
999 me.x = me.x === undefined ? pos.left: me.x;
1000 me.y = me.y === undefined ? pos.top: me.y;
1003 if (Ext.isDefined(me.x) || Ext.isDefined(me.y)) {
1004 me.setPosition(me.x, me.y);
1007 if (me.styleHtmlContent) {
1008 me.getTargetEl().addCls(me.styleHtmlCls);
1012 frameCls: Ext.baseCSSPrefix + 'frame',
1015 '<tpl if="top">',
1016 '<tpl if="left"><div class="{frameCls}-tl {baseCls}-tl {baseCls}-{ui}-tl<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tl</tpl></tpl>" style="background-position: {tl}; padding-left: {frameWidth}px" role="presentation"></tpl>',
1017 '<tpl if="right"><div class="{frameCls}-tr {baseCls}-tr {baseCls}-{ui}-tr<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tr</tpl></tpl>" style="background-position: {tr}; padding-right: {frameWidth}px" role="presentation"></tpl>',
1018 '<div class="{frameCls}-tc {baseCls}-tc {baseCls}-{ui}-tc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tc</tpl></tpl>" style="background-position: {tc}; height: {frameWidth}px" role="presentation"></div>',
1019 '<tpl if="right"></div></tpl>',
1020 '<tpl if="left"></div></tpl>',
1022 '<tpl if="left"><div class="{frameCls}-ml {baseCls}-ml {baseCls}-{ui}-ml<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-ml</tpl></tpl>" style="background-position: {ml}; padding-left: {frameWidth}px" role="presentation"></tpl>',
1023 '<tpl if="right"><div class="{frameCls}-mr {baseCls}-mr {baseCls}-{ui}-mr<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mr</tpl></tpl>" style="background-position: {mr}; padding-right: {frameWidth}px" role="presentation"></tpl>',
1024 '<div class="{frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl></tpl>" role="presentation"></div>',
1025 '<tpl if="right"></div></tpl>',
1026 '<tpl if="left"></div></tpl>',
1027 '<tpl if="bottom">',
1028 '<tpl if="left"><div class="{frameCls}-bl {baseCls}-bl {baseCls}-{ui}-bl<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bl</tpl></tpl>" style="background-position: {bl}; padding-left: {frameWidth}px" role="presentation"></tpl>',
1029 '<tpl if="right"><div class="{frameCls}-br {baseCls}-br {baseCls}-{ui}-br<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-br</tpl></tpl>" style="background-position: {br}; padding-right: {frameWidth}px" role="presentation"></tpl>',
1030 '<div class="{frameCls}-bc {baseCls}-bc {baseCls}-{ui}-bc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bc</tpl></tpl>" style="background-position: {bc}; height: {frameWidth}px" role="presentation"></div>',
1031 '<tpl if="right"></div></tpl>',
1032 '<tpl if="left"></div></tpl>',
1037 '<table><tbody>',
1038 '<tpl if="top">',
1040 '<tpl if="left"><td class="{frameCls}-tl {baseCls}-tl {baseCls}-{ui}-tl<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tl</tpl></tpl>" style="background-position: {tl}; padding-left:{frameWidth}px" role="presentation"></td></tpl>',
1041 '<td class="{frameCls}-tc {baseCls}-tc {baseCls}-{ui}-tc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tc</tpl></tpl>" style="background-position: {tc}; height: {frameWidth}px" role="presentation"></td>',
1042 '<tpl if="right"><td class="{frameCls}-tr {baseCls}-tr {baseCls}-{ui}-tr<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tr</tpl></tpl>" style="background-position: {tr}; padding-left: {frameWidth}px" role="presentation"></td></tpl>',
1046 '<tpl if="left"><td class="{frameCls}-ml {baseCls}-ml {baseCls}-{ui}-ml<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-ml</tpl></tpl>" style="background-position: {ml}; padding-left: {frameWidth}px" role="presentation"></td></tpl>',
1047 '<td class="{frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl></tpl>" style="background-position: 0 0;" role="presentation"></td>',
1048 '<tpl if="right"><td class="{frameCls}-mr {baseCls}-mr {baseCls}-{ui}-mr<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mr</tpl></tpl>" style="background-position: {mr}; padding-left: {frameWidth}px" role="presentation"></td></tpl>',
1050 '<tpl if="bottom">',
1052 '<tpl if="left"><td class="{frameCls}-bl {baseCls}-bl {baseCls}-{ui}-bl<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bl</tpl></tpl>" style="background-position: {bl}; padding-left: {frameWidth}px" role="presentation"></td></tpl>',
1053 '<td class="{frameCls}-bc {baseCls}-bc {baseCls}-{ui}-bc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bc</tpl></tpl>" style="background-position: {bc}; height: {frameWidth}px" role="presentation"></td>',
1054 '<tpl if="right"><td class="{frameCls}-br {baseCls}-br {baseCls}-{ui}-br<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-br</tpl></tpl>" style="background-position: {br}; padding-left: {frameWidth}px" role="presentation"></td></tpl>',
1057 '</tbody></table>'
1060 <span id='Ext-AbstractComponent-method-initFrame'> /**
1063 initFrame : function() {
1064 if (Ext.supports.CSS3BorderRadius) {
1069 frameInfo = me.getFrameInfo(),
1070 frameWidth = frameInfo.width,
1071 frameTpl = me.getFrameTpl(frameInfo.table);
1074 // Here we render the frameTpl to this component. This inserts the 9point div or the table framing.
1075 frameTpl.insertFirst(me.el, Ext.apply({}, {
1078 frameCls: me.frameCls,
1079 baseCls: me.baseCls,
1080 frameWidth: frameWidth,
1081 top: !!frameInfo.top,
1082 left: !!frameInfo.left,
1083 right: !!frameInfo.right,
1084 bottom: !!frameInfo.bottom
1085 }, me.getFramePositions(frameInfo)));
1087 // The frameBody is returned in getTargetEl, so that layouts render items to the correct target.=
1088 me.frameBody = me.el.down('.' + me.frameCls + '-mc');
1090 // Add the render selectors for each of the frame elements
1091 Ext.apply(me.renderSelectors, {
1092 frameTL: '.' + me.baseCls + '-tl',
1093 frameTC: '.' + me.baseCls + '-tc',
1094 frameTR: '.' + me.baseCls + '-tr',
1095 frameML: '.' + me.baseCls + '-ml',
1096 frameMC: '.' + me.baseCls + '-mc',
1097 frameMR: '.' + me.baseCls + '-mr',
1098 frameBL: '.' + me.baseCls + '-bl',
1099 frameBC: '.' + me.baseCls + '-bc',
1100 frameBR: '.' + me.baseCls + '-br'
1105 updateFrame: function() {
1106 if (Ext.supports.CSS3BorderRadius) {
1111 wasTable = this.frameSize && this.frameSize.table,
1112 oldFrameTL = this.frameTL,
1113 oldFrameBL = this.frameBL,
1114 oldFrameML = this.frameML,
1115 oldFrameMC = this.frameMC,
1122 // Reapply render selectors
1132 this.applyRenderSelectors();
1134 // Store the class names set on the new mc
1135 newMCClassName = this.frameMC.dom.className;
1137 // Replace the new mc with the old mc
1138 oldFrameMC.insertAfter(this.frameMC);
1139 this.frameMC.remove();
1141 // Restore the reference to the old frame mc as the framebody
1142 this.frameBody = this.frameMC = oldFrameMC;
1144 // Apply the new mc classes to the old mc element
1145 oldFrameMC.dom.className = newMCClassName;
1147 // Remove the old framing
1149 me.el.query('> table')[1].remove();
1153 oldFrameTL.remove();
1156 oldFrameBL.remove();
1158 oldFrameML.remove();
1162 // We were framed but not anymore. Move all content from the old frame to the body
1166 else if (me.frame) {
1167 this.applyRenderSelectors();
1171 getFrameInfo: function() {
1172 if (Ext.supports.CSS3BorderRadius) {
1177 left = me.el.getStyle('background-position-x'),
1178 top = me.el.getStyle('background-position-y'),
1179 info, frameInfo = false, max;
1181 // Some browsers dont support background-position-x and y, so for those
1182 // browsers let's split background-position into two parts.
1183 if (!left && !top) {
1184 info = me.el.getStyle('background-position').split(' ');
1189 // We actually pass a string in the form of '[type][tl][tr]px [type][br][bl]px' as
1190 // the background position of this.el from the css to indicate to IE that this component needs
1191 // framing. We parse it here and change the markup accordingly.
1192 if (parseInt(left, 10) >= 1000000 && parseInt(top, 10) >= 1000000) {
1196 // Table markup starts with 110, div markup with 100.
1197 table: left.substr(0, 3) == '110',
1199 // Determine if we are dealing with a horizontal or vertical component
1200 vertical: top.substr(0, 3) == '110',
1202 // Get and parse the different border radius sizes
1203 top: max(left.substr(3, 2), left.substr(5, 2)),
1204 right: max(left.substr(5, 2), top.substr(3, 2)),
1205 bottom: max(top.substr(3, 2), top.substr(5, 2)),
1206 left: max(top.substr(5, 2), left.substr(3, 2))
1209 frameInfo.width = max(frameInfo.top, frameInfo.right, frameInfo.bottom, frameInfo.left);
1211 // Just to be sure we set the background image of the el to none.
1212 me.el.setStyle('background-image', 'none');
1215 // This happens when you set frame: true explicitly without using the x-frame mixin in sass.
1216 // This way IE can't figure out what sizes to use and thus framing can't work.
1217 if (me.frame === true && !frameInfo) {
1218 //<debug error>
1219 Ext.Error.raise("You have set frame: true explicity on this component while it doesn't have any " +
1220 "framing defined in the CSS template. In this case IE can't figure out what sizes " +
1221 "to use and thus framing on this component will be disabled.");
1225 me.frame = me.frame || !!frameInfo;
1226 me.frameSize = frameInfo || false;
1231 getFramePositions: function(frameInfo) {
1233 frameWidth = frameInfo.width,
1235 positions, tc, bc, ml, mr;
1237 if (frameInfo.vertical) {
1238 tc = '0 -' + (frameWidth * 0) + 'px';
1239 bc = '0 -' + (frameWidth * 1) + 'px';
1241 if (dock && dock == "right") {
1242 tc = 'right -' + (frameWidth * 0) + 'px';
1243 bc = 'right -' + (frameWidth * 1) + 'px';
1247 tl: '0 -' + (frameWidth * 0) + 'px',
1248 tr: '0 -' + (frameWidth * 1) + 'px',
1249 bl: '0 -' + (frameWidth * 2) + 'px',
1250 br: '0 -' + (frameWidth * 3) + 'px',
1252 ml: '-' + (frameWidth * 1) + 'px 0',
1259 ml = '-' + (frameWidth * 0) + 'px 0';
1262 if (dock && dock == "bottom") {
1264 mr = 'right bottom';
1268 tl: '0 -' + (frameWidth * 2) + 'px',
1269 tr: 'right -' + (frameWidth * 3) + 'px',
1270 bl: '0 -' + (frameWidth * 4) + 'px',
1271 br: 'right -' + (frameWidth * 5) + 'px',
1276 tc: '0 -' + (frameWidth * 0) + 'px',
1277 bc: '0 -' + (frameWidth * 1) + 'px'
1284 <span id='Ext-AbstractComponent-method-getFrameTpl'> /**
1287 getFrameTpl : function(table) {
1288 return table ? this.getTpl('frameTableTpl') : this.getTpl('frameTpl');
1291 <span id='Ext-AbstractComponent-method-initCls'> /**
1292 </span> * <p>Creates an array of class names from the configurations to add to this Component's <code>el</code> on render.</p>
1293 * <p>Private, but (possibly) used by ComponentQuery for selection by class name if Component is not rendered.</p>
1294 * @return {Array} An array of class names with which the Component's element will be rendered.
1297 initCls: function() {
1301 cls.push(me.baseCls);
1303 //<deprecated since=0.99>
1304 if (Ext.isDefined(me.cmpCls)) {
1305 if (Ext.isDefined(Ext.global.console)) {
1306 Ext.global.console.warn('Ext.Component: cmpCls has been deprecated. Please use componentCls.');
1308 me.componentCls = me.cmpCls;
1311 //</deprecated>
1313 if (me.componentCls) {
1314 cls.push(me.componentCls);
1316 me.componentCls = me.baseCls;
1323 return cls.concat(me.additionalCls);
1326 <span id='Ext-AbstractComponent-method-setUI'> /**
1327 </span> * Sets the UI for the component. This will remove any existing UIs on the component. It will also
1328 * loop through any uiCls set on the component and rename them so they include the new UI
1329 * @param {String} ui The new UI for the component
1331 setUI: function(ui) {
1333 oldUICls = Ext.Array.clone(me.uiCls),
1338 //loop through all exisiting uiCls and update the ui in them
1339 for (i = 0; i < oldUICls.length; i++) {
1342 me.removeClsWithUI(cls);
1346 //remove the UI from the element
1347 me.removeUIFromElement();
1352 //add the new UI to the elemend
1353 me.addUIToElement();
1355 //loop through all exisiting uiCls and update the ui in them
1356 for (i = 0; i < newUICls.length; i++) {
1359 me.addClsWithUI(cls);
1363 <span id='Ext-AbstractComponent-method-addClsWithUI'> /**
1364 </span> * Adds a cls to the uiCls array, which will also call {@link #addUIClsToElement} and adds
1365 * to all elements of this component.
1366 * @param {String/Array} cls A string or an array of strings to add to the uiCls
1368 addClsWithUI: function(cls) {
1372 if (!Ext.isArray(cls)) {
1376 for (i = 0; i < cls.length; i++) {
1377 if (cls[i] && !me.hasUICls(cls[i])) {
1378 me.uiCls = Ext.Array.clone(me.uiCls);
1379 me.uiCls.push(cls[i]);
1380 me.addUIClsToElement(cls[i]);
1385 <span id='Ext-AbstractComponent-method-removeClsWithUI'> /**
1386 </span> * Removes a cls to the uiCls array, which will also call {@link #removeUIClsToElement} and removes
1387 * it from all elements of this component.
1388 * @param {String/Array} cls A string or an array of strings to remove to the uiCls
1390 removeClsWithUI: function(cls) {
1394 if (!Ext.isArray(cls)) {
1398 for (i = 0; i < cls.length; i++) {
1399 if (cls[i] && me.hasUICls(cls[i])) {
1400 me.uiCls = Ext.Array.remove(me.uiCls, cls[i]);
1401 me.removeUIClsFromElement(cls[i]);
1406 <span id='Ext-AbstractComponent-method-hasUICls'> /**
1407 </span> * Checks if there is currently a specified uiCls
1408 * @param {String} cls The cls to check
1410 hasUICls: function(cls) {
1412 uiCls = me.uiCls || [];
1414 return Ext.Array.contains(uiCls, cls);
1417 <span id='Ext-AbstractComponent-method-addUIClsToElement'> /**
1418 </span> * Method which adds a specified UI + uiCls to the components element.
1419 * Can be overridden to remove the UI from more than just the components element.
1420 * @param {String} ui The UI to remove from the element
1423 addUIClsToElement: function(cls, force) {
1426 me.addCls(Ext.baseCSSPrefix + cls);
1427 me.addCls(me.baseCls + '-' + cls);
1428 me.addCls(me.baseCls + '-' + me.ui + '-' + cls);
1430 if (!force && me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1431 // define each element of the frame
1432 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1435 // loop through each of them, and if they are defined add the ui
1436 for (i = 0; i < els.length; i++) {
1437 el = me['frame' + els[i].toUpperCase()];
1439 if (el && el.dom) {
1440 el.addCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1441 el.addCls(me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i]);
1447 <span id='Ext-AbstractComponent-method-removeUIClsFromElement'> /**
1448 </span> * Method which removes a specified UI + uiCls from the components element.
1449 * The cls which is added to the element will be: `this.baseCls + '-' + ui`
1450 * @param {String} ui The UI to add to the element
1453 removeUIClsFromElement: function(cls, force) {
1456 me.removeCls(Ext.baseCSSPrefix + cls);
1457 me.removeCls(me.baseCls + '-' + cls);
1458 me.removeCls(me.baseCls + '-' + me.ui + '-' + cls);
1460 if (!force &&me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1461 // define each element of the frame
1462 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1465 // loop through each of them, and if they are defined add the ui
1466 for (i = 0; i < els.length; i++) {
1467 el = me['frame' + els[i].toUpperCase()];
1468 if (el && el.dom) {
1469 el.removeCls(me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i]);
1475 <span id='Ext-AbstractComponent-method-addUIToElement'> /**
1476 </span> * Method which adds a specified UI to the components element.
1479 addUIToElement: function(force) {
1482 me.addCls(me.baseCls + '-' + me.ui);
1484 if (me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1485 // define each element of the frame
1486 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1489 // loop through each of them, and if they are defined add the ui
1490 for (i = 0; i < els.length; i++) {
1491 el = me['frame' + els[i].toUpperCase()];
1494 el.addCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1500 <span id='Ext-AbstractComponent-method-removeUIFromElement'> /**
1501 </span> * Method which removes a specified UI from the components element.
1504 removeUIFromElement: function() {
1507 me.removeCls(me.baseCls + '-' + me.ui);
1509 if (me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1510 // define each element of the frame
1511 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1514 // loop through each of them, and if they are defined add the ui
1515 for (i = 0; i < els.length; i++) {
1516 el = me['frame' + els[i].toUpperCase()];
1518 el.removeCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1524 getElConfig : function() {
1525 var result = this.autoEl || {tag: 'div'};
1526 result.id = this.id;
1530 <span id='Ext-AbstractComponent-method-getInsertPosition'> /**
1531 </span> * This function takes the position argument passed to onRender and returns a
1532 * DOM element that you can use in the insertBefore.
1533 * @param {String/Number/Element/HTMLElement} position Index, element id or element you want
1534 * to put this component before.
1535 * @return {HTMLElement} DOM element that you can use in the insertBefore
1537 getInsertPosition: function(position) {
1538 // Convert the position to an element to insert before
1539 if (position !== undefined) {
1540 if (Ext.isNumber(position)) {
1541 position = this.container.dom.childNodes[position];
1544 position = Ext.getDom(position);
1551 <span id='Ext-AbstractComponent-method-initContainer'> /**
1552 </span> * Adds ctCls to container.
1553 * @return {Ext.core.Element} The initialized container
1556 initContainer: function(container) {
1559 // If you render a component specifying the el, we get the container
1560 // of the el, and make sure we dont move the el around in the dom
1561 // during the render
1562 if (!container && me.el) {
1563 container = me.el.dom.parentNode;
1564 me.allowDomMove = false;
1567 me.container = Ext.get(container);
1570 me.container.addCls(me.ctCls);
1573 return me.container;
1576 <span id='Ext-AbstractComponent-method-initRenderData'> /**
1577 </span> * Initialized the renderData to be used when rendering the renderTpl.
1578 * @return {Object} Object with keys and values that are going to be applied to the renderTpl
1581 initRenderData: function() {
1584 return Ext.applyIf(me.renderData, {
1587 baseCls: me.baseCls,
1588 componentCls: me.componentCls,
1593 <span id='Ext-AbstractComponent-method-getTpl'> /**
1596 getTpl: function(name) {
1597 var prototype = this.self.prototype,
1600 if (this.hasOwnProperty(name)) {
1601 if (!(this[name] instanceof Ext.XTemplate)) {
1602 this[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', this[name]);
1608 if (!(prototype[name] instanceof Ext.XTemplate)) {
1609 ownerPrototype = prototype;
1612 if (ownerPrototype.hasOwnProperty(name)) {
1613 ownerPrototype[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', ownerPrototype[name]);
1617 ownerPrototype = ownerPrototype.superclass;
1618 } while (ownerPrototype);
1621 return prototype[name];
1624 <span id='Ext-AbstractComponent-method-initRenderTpl'> /**
1625 </span> * Initializes the renderTpl.
1626 * @return {Ext.XTemplate} The renderTpl XTemplate instance.
1629 initRenderTpl: function() {
1630 return this.getTpl('renderTpl');
1633 <span id='Ext-AbstractComponent-method-initStyles'> /**
1634 </span> * Function description
1635 * @return {String} A CSS style string with style, padding, margin and border.
1638 initStyles: function() {
1641 Element = Ext.core.Element;
1643 if (Ext.isString(me.style)) {
1644 style = Element.parseStyles(me.style);
1646 style = Ext.apply({}, me.style);
1649 // Convert the padding, margin and border properties from a space seperated string
1650 // into a proper style string
1651 if (me.padding !== undefined) {
1652 style.padding = Element.unitizeBox((me.padding === true) ? 5 : me.padding);
1655 if (me.margin !== undefined) {
1656 style.margin = Element.unitizeBox((me.margin === true) ? 5 : me.margin);
1663 <span id='Ext-AbstractComponent-method-initContent'> /**
1664 </span> * Initializes this components contents. It checks for the properties
1665 * html, contentEl and tpl/data.
1668 initContent: function() {
1670 target = me.getTargetEl(),
1675 target.update(Ext.core.DomHelper.markup(me.html));
1680 contentEl = Ext.get(me.contentEl);
1681 pre = Ext.baseCSSPrefix;
1682 contentEl.removeCls([pre + 'hidden', pre + 'hide-display', pre + 'hide-offsets', pre + 'hide-nosize']);
1683 target.appendChild(contentEl.dom);
1687 // Make sure this.tpl is an instantiated XTemplate
1688 if (!me.tpl.isTemplate) {
1689 me.tpl = Ext.create('Ext.XTemplate', me.tpl);
1693 me.tpl[me.tplWriteMode](target, me.data);
1700 initEvents : function() {
1702 afterRenderEvents = me.afterRenderEvents,
1705 fn = function(listeners){
1706 me.mon(el, listeners);
1708 if (afterRenderEvents) {
1709 for (property in afterRenderEvents) {
1710 if (afterRenderEvents.hasOwnProperty(property)) {
1712 if (el && el.on) {
1713 Ext.each(afterRenderEvents[property], fn);
1720 <span id='Ext-AbstractComponent-method-applyRenderSelectors'> /**
1721 </span> * Sets references to elements inside the component. E.g body -> x-panel-body
1724 applyRenderSelectors: function() {
1725 var selectors = this.renderSelectors || {},
1729 for (selector in selectors) {
1730 if (selectors.hasOwnProperty(selector) && selectors[selector]) {
1731 this[selector] = Ext.get(Ext.DomQuery.selectNode(selectors[selector], el));
1736 <span id='Ext-AbstractComponent-method-is'> /**
1737 </span> * Tests whether this Component matches the selector string.
1738 * @param {String} selector The selector string to test against.
1739 * @return {Boolean} True if this Component matches the selector.
1741 is: function(selector) {
1742 return Ext.ComponentQuery.is(this, selector);
1745 <span id='Ext-AbstractComponent-method-up'> /**
1746 </span> * <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches
1747 * the passed simple selector.</p>
1748 * <p>Example:<pre><code>
1749 var owningTabPanel = grid.up('tabpanel');
1750 </code></pre>
1751 * @param {String} selector Optional. The simple selector to test.
1752 * @return {Container} The matching ancestor Container (or <code>undefined</code> if no match was found).
1754 up: function(selector) {
1755 var result = this.ownerCt;
1757 for (; result; result = result.ownerCt) {
1758 if (Ext.ComponentQuery.is(result, selector)) {
1766 <span id='Ext-AbstractComponent-method-nextSibling'> /**
1767 </span> * <p>Returns the next sibling of this Component.</p>
1768 * <p>Optionally selects the next sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery} selector.</p>
1769 * <p>May also be refered to as <code><b>next()</b></code></p>
1770 * <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with {@link #nextNode}</p>
1771 * @param {String} selector Optional A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following items.
1772 * @returns The next sibling (or the next sibling which matches the selector). Returns null if there is no matching sibling.
1774 nextSibling: function(selector) {
1775 var o = this.ownerCt, it, last, idx, c;
1778 idx = it.indexOf(this) + 1;
1781 for (last = it.getCount(); idx < last; idx++) {
1782 if ((c = it.getAt(idx)).is(selector)) {
1787 if (idx < it.getCount()) {
1788 return it.getAt(idx);
1796 <span id='Ext-AbstractComponent-method-previousSibling'> /**
1797 </span> * <p>Returns the previous sibling of this Component.</p>
1798 * <p>Optionally selects the previous sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery} selector.</p>
1799 * <p>May also be refered to as <code><b>prev()</b></code></p>
1800 * <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with {@link #previousNode}</p>
1801 * @param {String} selector Optional. A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding items.
1802 * @returns The previous sibling (or the previous sibling which matches the selector). Returns null if there is no matching sibling.
1804 previousSibling: function(selector) {
1805 var o = this.ownerCt, it, idx, c;
1808 idx = it.indexOf(this);
1811 for (--idx; idx >= 0; idx--) {
1812 if ((c = it.getAt(idx)).is(selector)) {
1818 return it.getAt(--idx);
1826 <span id='Ext-AbstractComponent-method-previousNode'> /**
1827 </span> * <p>Returns the previous node in the Component tree in tree traversal order.</p>
1828 * <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will
1829 * walk the tree in reverse order to attempt to find a match. Contrast with {@link #previousSibling}.</p>
1830 * @param {String} selector Optional. A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding nodes.
1831 * @returns The previous node (or the previous node which matches the selector). Returns null if there is no matching node.
1833 previousNode: function(selector, includeSelf) {
1838 // If asked to include self, test me
1839 if (includeSelf && node.is(selector)) {
1843 result = this.prev(selector);
1849 for (it = node.ownerCt.items.items, i = Ext.Array.indexOf(it, node) - 1; i > -1; i--) {
1851 result = it[i].query(selector);
1852 result = result[result.length - 1];
1858 return node.ownerCt.previousNode(selector, true);
1862 <span id='Ext-AbstractComponent-method-nextNode'> /**
1863 </span> * <p>Returns the next node in the Component tree in tree traversal order.</p>
1864 * <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will
1865 * walk the tree to attempt to find a match. Contrast with {@link #pnextSibling}.</p>
1866 * @param {String} selector Optional A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following nodes.
1867 * @returns The next node (or the next node which matches the selector). Returns null if there is no matching node.
1869 nextNode: function(selector, includeSelf) {
1874 // If asked to include self, test me
1875 if (includeSelf && node.is(selector)) {
1879 result = this.next(selector);
1885 for (it = node.ownerCt.items, i = it.indexOf(node) + 1, it = it.items, len = it.length; i < len; i++) {
1887 result = it[i].down(selector);
1893 return node.ownerCt.nextNode(selector);
1897 <span id='Ext-AbstractComponent-method-getId'> /**
1898 </span> * Retrieves the id of this component.
1899 * Will autogenerate an id if one has not already been set.
1901 getId : function() {
1902 return this.id || (this.id = 'ext-comp-' + (this.getAutoId()));
1905 getItemId : function() {
1906 return this.itemId || this.id;
1909 <span id='Ext-AbstractComponent-method-getEl'> /**
1910 </span> * Retrieves the top level element representing this component.
1912 getEl : function() {
1916 <span id='Ext-AbstractComponent-method-getTargetEl'> /**
1917 </span> * This is used to determine where to insert the 'html', 'contentEl' and 'items' in this component.
1920 getTargetEl: function() {
1921 return this.frameBody || this.el;
1924 <span id='Ext-AbstractComponent-method-isXType'> /**
1925 </span> * <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
1926 * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p>
1927 * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
1928 * to participate in determination of inherited xtypes.</b></p>
1929 * <p>For a list of all available xtypes, see the {@link Ext.Component} header.</p>
1930 * <p>Example usage:</p>
1931 * <pre><code>
1932 var t = new Ext.form.field.Text();
1933 var isText = t.isXType('textfield'); // true
1934 var isBoxSubclass = t.isXType('field'); // true, descended from Ext.form.field.Base
1935 var isBoxInstance = t.isXType('field', true); // false, not a direct Ext.form.field.Base instance
1936 </code></pre>
1937 * @param {String} xtype The xtype to check for this Component
1938 * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
1939 * the default), or true to check whether this Component is directly of the specified xtype.
1940 * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
1942 isXType: function(xtype, shallow) {
1943 //assume a string by default
1944 if (Ext.isFunction(xtype)) {
1945 xtype = xtype.xtype;
1946 //handle being passed the class, e.g. Ext.Component
1947 } else if (Ext.isObject(xtype)) {
1948 xtype = xtype.statics().xtype;
1949 //handle being passed an instance
1952 return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1: this.self.xtype == xtype;
1955 <span id='Ext-AbstractComponent-method-getXTypes'> /**
1956 </span> * <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
1957 * available xtypes, see the {@link Ext.Component} header.</p>
1958 * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
1959 * to participate in determination of inherited xtypes.</b></p>
1960 * <p>Example usage:</p>
1961 * <pre><code>
1962 var t = new Ext.form.field.Text();
1963 alert(t.getXTypes()); // alerts 'component/field/textfield'
1964 </code></pre>
1965 * @return {String} The xtype hierarchy string
1967 getXTypes: function() {
1968 var self = this.self,
1970 parentPrototype = this,
1974 while (parentPrototype && Ext.getClass(parentPrototype)) {
1975 xtype = Ext.getClass(parentPrototype).xtype;
1977 if (xtype !== undefined) {
1978 xtypes.unshift(xtype);
1981 parentPrototype = parentPrototype.superclass;
1984 self.xtypeChain = xtypes;
1985 self.xtypes = xtypes.join('/');
1991 <span id='Ext-AbstractComponent-method-update'> /**
1992 </span> * Update the content area of a component.
1993 * @param {Mixed} htmlOrData
1994 * If this component has been configured with a template via the tpl config
1995 * then it will use this argument as data to populate the template.
1996 * If this component was not configured with a template, the components
1997 * content area will be updated via Ext.core.Element update
1998 * @param {Boolean} loadScripts
1999 * (optional) Only legitimate when using the html configuration. Defaults to false
2000 * @param {Function} callback
2001 * (optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
2003 update : function(htmlOrData, loadScripts, cb) {
2006 if (me.tpl && !Ext.isString(htmlOrData)) {
2007 me.data = htmlOrData;
2009 me.tpl[me.tplWriteMode](me.getTargetEl(), htmlOrData || {});
2012 me.html = Ext.isObject(htmlOrData) ? Ext.core.DomHelper.markup(htmlOrData) : htmlOrData;
2014 me.getTargetEl().update(me.html, loadScripts, cb);
2019 me.doComponentLayout();
2023 <span id='Ext-AbstractComponent-method-setVisible'> /**
2024 </span> * Convenience function to hide or show this component by boolean.
2025 * @param {Boolean} visible True to show, false to hide
2026 * @return {Ext.Component} this
2028 setVisible : function(visible) {
2029 return this[visible ? 'show': 'hide']();
2032 <span id='Ext-AbstractComponent-method-isVisible'> /**
2033 </span> * Returns true if this component is visible.
2034 * @param {Boolean} deep. <p>Optional. Pass <code>true</code> to interrogate the visibility status of all
2035 * parent Containers to determine whether this Component is truly visible to the user.</p>
2036 * <p>Generally, to determine whether a Component is hidden, the no argument form is needed. For example
2037 * when creating dynamically laid out UIs in a hidden Container before showing them.</p>
2038 * @return {Boolean} True if this component is visible, false otherwise.
2040 isVisible: function(deep) {
2043 visible = !me.hidden,
2044 ancestor = me.ownerCt;
2046 // Clear hiddenOwnerCt property
2047 me.hiddenAncestor = false;
2052 if (deep && visible && me.rendered && ancestor) {
2054 // If any ancestor is hidden, then this is hidden.
2055 // If an ancestor Panel (only Panels have a collapse method) is collapsed,
2056 // then its layoutTarget (body) is hidden, so this is hidden unless its within a
2057 // docked item; they are still visible when collapsed (Unless they themseves are hidden)
2058 if (ancestor.hidden || (ancestor.collapsed &&
2059 !(ancestor.getDockedItems && Ext.Array.contains(ancestor.getDockedItems(), child)))) {
2060 // Store hiddenOwnerCt property if needed
2061 me.hiddenAncestor = ancestor;
2066 ancestor = ancestor.ownerCt;
2072 <span id='Ext-AbstractComponent-method-enable'> /**
2073 </span> * Enable the component
2074 * @param {Boolean} silent
2075 * Passing false will supress the 'enable' event from being fired.
2077 enable: function(silent) {
2081 me.el.removeCls(me.disabledCls);
2082 me.el.dom.disabled = false;
2086 me.disabled = false;
2088 if (silent !== true) {
2089 me.fireEvent('enable', me);
2095 <span id='Ext-AbstractComponent-method-disable'> /**
2096 </span> * Disable the component.
2097 * @param {Boolean} silent
2098 * Passing true, will supress the 'disable' event from being fired.
2100 disable: function(silent) {
2104 me.el.addCls(me.disabledCls);
2105 me.el.dom.disabled = true;
2111 if (silent !== true) {
2112 me.fireEvent('disable', me);
2119 onEnable: function() {
2120 if (this.maskOnDisable) {
2126 onDisable : function() {
2127 if (this.maskOnDisable) {
2132 <span id='Ext-AbstractComponent-method-isDisabled'> /**
2133 </span> * Method to determine whether this Component is currently disabled.
2134 * @return {Boolean} the disabled state of this Component.
2136 isDisabled : function() {
2137 return this.disabled;
2140 <span id='Ext-AbstractComponent-method-setDisabled'> /**
2141 </span> * Enable or disable the component.
2142 * @param {Boolean} disabled
2144 setDisabled : function(disabled) {
2145 return this[disabled ? 'disable': 'enable']();
2148 <span id='Ext-AbstractComponent-method-isHidden'> /**
2149 </span> * Method to determine whether this Component is currently set to hidden.
2150 * @return {Boolean} the hidden state of this Component.
2152 isHidden : function() {
2156 <span id='Ext-AbstractComponent-method-addCls'> /**
2157 </span> * Adds a CSS class to the top level element representing this component.
2158 * @param {String} cls The CSS class name to add
2159 * @return {Ext.Component} Returns the Component to allow method chaining.
2161 addCls : function(className) {
2166 if (!Ext.isArray(className)){
2167 className = className.replace(me.trimRe, '').split(me.spacesRe);
2170 me.el.addCls(className);
2173 me.additionalCls = Ext.Array.unique(me.additionalCls.concat(className));
2178 <span id='Ext-AbstractComponent-method-addClass'> /**
2179 </span> * @deprecated 4.0 Replaced by {@link #addCls}
2180 * Adds a CSS class to the top level element representing this component.
2181 * @param {String} cls The CSS class name to add
2182 * @return {Ext.Component} Returns the Component to allow method chaining.
2184 addClass : function() {
2185 return this.addCls.apply(this, arguments);
2188 <span id='Ext-AbstractComponent-method-removeCls'> /**
2189 </span> * Removes a CSS class from the top level element representing this component.
2190 * @returns {Ext.Component} Returns the Component to allow method chaining.
2192 removeCls : function(className) {
2198 if (!Ext.isArray(className)){
2199 className = className.replace(me.trimRe, '').split(me.spacesRe);
2202 me.el.removeCls(className);
2204 else if (me.additionalCls.length) {
2205 Ext.each(className, function(cls) {
2206 Ext.Array.remove(me.additionalCls, cls);
2213 removeClass : function() {
2214 if (Ext.isDefined(Ext.global.console)) {
2215 Ext.global.console.warn('Ext.Component: removeClass has been deprecated. Please use removeCls.');
2217 return this.removeCls.apply(this, arguments);
2221 addOverCls: function() {
2224 me.el.addCls(me.overCls);
2228 removeOverCls: function() {
2229 this.el.removeCls(this.overCls);
2232 addListener : function(element, listeners, scope, options) {
2237 if (Ext.isString(element) && (Ext.isObject(listeners) || options && options.element)) {
2238 if (options.element) {
2242 listeners[element] = fn;
2243 element = options.element;
2245 listeners.scope = scope;
2248 for (option in options) {
2249 if (options.hasOwnProperty(option)) {
2250 if (me.eventOptionsRe.test(option)) {
2251 listeners[option] = options[option];
2257 // At this point we have a variable called element,
2258 // and a listeners object that can be passed to on
2259 if (me[element] && me[element].on) {
2260 me.mon(me[element], listeners);
2262 me.afterRenderEvents = me.afterRenderEvents || {};
2263 if (!me.afterRenderEvents[element]) {
2264 me.afterRenderEvents[element] = [];
2266 me.afterRenderEvents[element].push(listeners);
2270 return me.mixins.observable.addListener.apply(me, arguments);
2274 removeManagedListenerItem: function(isClear, managedListener, item, ename, fn, scope){
2276 element = managedListener.options ? managedListener.options.element : null;
2279 element = me[element];
2280 if (element && element.un) {
2281 if (isClear || (managedListener.item === item && managedListener.ename === ename && (!fn || managedListener.fn === fn) && (!scope || managedListener.scope === scope))) {
2282 element.un(managedListener.ename, managedListener.fn, managedListener.scope);
2284 Ext.Array.remove(me.managedListeners, managedListener);
2289 return me.mixins.observable.removeManagedListenerItem.apply(me, arguments);
2293 <span id='Ext-AbstractComponent-method-getBubbleTarget'> /**
2294 </span> * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
2295 * @return {Ext.container.Container} the Container which owns this Component.
2297 getBubbleTarget : function() {
2298 return this.ownerCt;
2301 <span id='Ext-AbstractComponent-method-isFloating'> /**
2302 </span> * Method to determine whether this Component is floating.
2303 * @return {Boolean} the floating state of this component.
2305 isFloating : function() {
2306 return this.floating;
2309 <span id='Ext-AbstractComponent-method-isDraggable'> /**
2310 </span> * Method to determine whether this Component is draggable.
2311 * @return {Boolean} the draggable state of this component.
2313 isDraggable : function() {
2314 return !!this.draggable;
2317 <span id='Ext-AbstractComponent-method-isDroppable'> /**
2318 </span> * Method to determine whether this Component is droppable.
2319 * @return {Boolean} the droppable state of this component.
2321 isDroppable : function() {
2322 return !!this.droppable;
2325 <span id='Ext-AbstractComponent-method-onAdded'> /**
2327 * Method to manage awareness of when components are added to their
2328 * respective Container, firing an added event.
2329 * References are established at add time rather than at render time.
2330 * @param {Ext.container.Container} container Container which holds the component
2331 * @param {number} pos Position at which the component was added
2333 onAdded : function(container, pos) {
2334 this.ownerCt = container;
2335 this.fireEvent('added', this, container, pos);
2338 <span id='Ext-AbstractComponent-method-onRemoved'> /**
2340 * Method to manage awareness of when components are removed from their
2341 * respective Container, firing an removed event. References are properly
2342 * cleaned up after removing a component from its owning container.
2344 onRemoved : function() {
2347 me.fireEvent('removed', me, me.ownerCt);
2352 beforeDestroy : Ext.emptyFn,
2355 onResize : Ext.emptyFn,
2357 <span id='Ext-AbstractComponent-method-setSize'> /**
2358 </span> * Sets the width and height of this Component. This method fires the {@link #resize} event. This method can accept
2359 * either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.
2360 * @param {Mixed} width The new width to set. This may be one of:<div class="mdetail-params"><ul>
2361 * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2362 * <li>A String used to set the CSS width style.</li>
2363 * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
2364 * <li><code>undefined</code> to leave the width unchanged.</li>
2365 * </ul></div>
2366 * @param {Mixed} height The new height to set (not required if a size object is passed as the first arg).
2367 * This may be one of:<div class="mdetail-params"><ul>
2368 * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2369 * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
2370 * <li><code>undefined</code> to leave the height unchanged.</li>
2371 * </ul></div>
2372 * @return {Ext.Component} this
2374 setSize : function(width, height) {
2378 // support for standard size objects
2379 if (Ext.isObject(width)) {
2380 height = width.height;
2381 width = width.width;
2384 // Constrain within configured maxima
2385 if (Ext.isNumber(width)) {
2386 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2388 if (Ext.isNumber(height)) {
2389 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2392 if (!me.rendered || !me.isVisible()) {
2393 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2394 if (me.hiddenAncestor) {
2395 layoutCollection = me.hiddenAncestor.layoutOnShow;
2396 layoutCollection.remove(me);
2397 layoutCollection.add(me);
2405 me.width = (width !== undefined) ? width : me.width;
2406 me.height = (height !== undefined) ? height : me.height;
2410 me.doComponentLayout(width, height, true);
2415 setCalculatedSize : function(width, height, ownerCt) {
2419 // support for standard size objects
2420 if (Ext.isObject(width)) {
2421 ownerCt = width.ownerCt;
2422 height = width.height;
2423 width = width.width;
2426 // Constrain within configured maxima
2427 if (Ext.isNumber(width)) {
2428 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2430 if (Ext.isNumber(height)) {
2431 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2434 if (!me.rendered || !me.isVisible()) {
2435 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2436 if (me.hiddenAncestor) {
2437 layoutCollection = me.hiddenAncestor.layoutOnShow;
2438 layoutCollection.remove(me);
2439 layoutCollection.add(me);
2449 me.doComponentLayout(width, height, false, ownerCt);
2454 <span id='Ext-AbstractComponent-method-doComponentLayout'> /**
2455 </span> * This method needs to be called whenever you change something on this component that requires the Component's
2456 * layout to be recalculated.
2457 * @return {Ext.container.Container} this
2459 doComponentLayout : function(width, height, isSetSize, ownerCt) {
2461 componentLayout = me.getComponentLayout();
2463 // collapsed state is not relevant here, so no testing done.
2464 // Only Panels have a collapse method, and that just sets the width/height such that only
2465 // a single docked Header parallel to the collapseTo side are visible, and the Panel body is hidden.
2466 if (me.rendered && componentLayout) {
2467 width = (width !== undefined) ? width : me.width;
2468 height = (height !== undefined) ? height : me.height;
2474 componentLayout.layout(width, height, isSetSize, ownerCt);
2480 setComponentLayout : function(layout) {
2481 var currentLayout = this.componentLayout;
2482 if (currentLayout && currentLayout.isLayout && currentLayout != layout) {
2483 currentLayout.setOwner(null);
2485 this.componentLayout = layout;
2486 layout.setOwner(this);
2489 getComponentLayout : function() {
2492 if (!me.componentLayout || !me.componentLayout.isLayout) {
2493 me.setComponentLayout(Ext.layout.Layout.create(me.componentLayout, 'autocomponent'));
2495 return me.componentLayout;
2498 <span id='Ext-AbstractComponent-method-afterComponentLayout'> /**
2499 </span> * @param {Number} adjWidth The box-adjusted width that was set
2500 * @param {Number} adjHeight The box-adjusted height that was set
2501 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
2502 * @param {Ext.Component} layoutOwner Component which sent the layout. Only used when isSetSize is false.
2504 afterComponentLayout: function(width, height, isSetSize, layoutOwner) {
2505 this.fireEvent('resize', this, width, height);
2508 <span id='Ext-AbstractComponent-method-beforeComponentLayout'> /**
2509 </span> * Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout
2510 * from being executed.
2511 * @param {Number} adjWidth The box-adjusted width that was set
2512 * @param {Number} adjHeight The box-adjusted height that was set
2513 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
2514 * @param {Ext.Component} layoutOwner Component which sent the layout. Only used when isSetSize is false.
2516 beforeComponentLayout: function(width, height, isSetSize, layoutOwner) {
2520 <span id='Ext-AbstractComponent-method-setPosition'> /**
2521 </span> * Sets the left and top of the component. To set the page XY position instead, use {@link #setPagePosition}.
2522 * This method fires the {@link #move} event.
2523 * @param {Number} left The new left
2524 * @param {Number} top The new top
2525 * @return {Ext.Component} this
2527 setPosition : function(x, y) {
2530 if (Ext.isObject(x)) {
2539 if (x !== undefined || y !== undefined) {
2541 me.onPosition(x, y);
2542 me.fireEvent('move', me, x, y);
2548 * Called after the component is moved, this method is empty by default but can be implemented by any
2549 * subclass that needs to perform custom logic after a move occurs.
2550 * @param {Number} x The new x position
2551 * @param {Number} y The new y position
2553 onPosition: Ext.emptyFn,
2555 <span id='Ext-AbstractComponent-method-setWidth'> /**
2556 </span> * Sets the width of the component. This method fires the {@link #resize} event.
2557 * @param {Number} width The new width to setThis may be one of:<div class="mdetail-params"><ul>
2558 * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2559 * <li>A String used to set the CSS width style.</li>
2560 * </ul></div>
2561 * @return {Ext.Component} this
2563 setWidth : function(width) {
2564 return this.setSize(width);
2567 <span id='Ext-AbstractComponent-method-setHeight'> /**
2568 </span> * Sets the height of the component. This method fires the {@link #resize} event.
2569 * @param {Number} height The new height to set. This may be one of:<div class="mdetail-params"><ul>
2570 * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2571 * <li>A String used to set the CSS height style.</li>
2572 * <li><i>undefined</i> to leave the height unchanged.</li>
2573 * </ul></div>
2574 * @return {Ext.Component} this
2576 setHeight : function(height) {
2577 return this.setSize(undefined, height);
2580 <span id='Ext-AbstractComponent-method-getSize'> /**
2581 </span> * Gets the current size of the component's underlying element.
2582 * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
2584 getSize : function() {
2585 return this.el.getSize();
2588 <span id='Ext-AbstractComponent-method-getWidth'> /**
2589 </span> * Gets the current width of the component's underlying element.
2592 getWidth : function() {
2593 return this.el.getWidth();
2596 <span id='Ext-AbstractComponent-method-getHeight'> /**
2597 </span> * Gets the current height of the component's underlying element.
2600 getHeight : function() {
2601 return this.el.getHeight();
2604 <span id='Ext-AbstractComponent-method-getLoader'> /**
2605 </span> * Gets the {@link Ext.ComponentLoader} for this Component.
2606 * @return {Ext.ComponentLoader} The loader instance, null if it doesn't exist.
2608 getLoader: function(){
2610 autoLoad = me.autoLoad ? (Ext.isObject(me.autoLoad) ? me.autoLoad : {url: me.autoLoad}) : null,
2611 loader = me.loader || autoLoad;
2614 if (!loader.isLoader) {
2615 me.loader = Ext.create('Ext.ComponentLoader', Ext.apply({
2620 loader.setTarget(me);
2628 <span id='Ext-AbstractComponent-method-setLoading'> /**
2629 </span> * This method allows you to show or hide a LoadMask on top of this component.
2630 * @param {Boolean/Object/String} load True to show the default LoadMask, a config object
2631 * that will be passed to the LoadMask constructor, or a message String to show. False to
2632 * hide the current LoadMask.
2633 * @param {Boolean} targetEl True to mask the targetEl of this Component instead of the this.el.
2634 * For example, setting this to true on a Panel will cause only the body to be masked. (defaults to false)
2635 * @return {Ext.LoadMask} The LoadMask instance that has just been shown.
2637 setLoading : function(load, targetEl) {
2642 if (load !== false && !me.collapsed) {
2643 if (Ext.isObject(load)) {
2646 else if (Ext.isString(load)) {
2647 config = {msg: load};
2652 me.loadMask = me.loadMask || Ext.create('Ext.LoadMask', targetEl ? me.getTargetEl() : me.el, config);
2654 } else if (me.loadMask) {
2655 Ext.destroy(me.loadMask);
2663 <span id='Ext-AbstractComponent-method-setDocked'> /**
2664 </span> * Sets the dock position of this component in its parent panel. Note that
2665 * this only has effect if this item is part of the dockedItems collection
2666 * of a parent that has a DockLayout (note that any Panel has a DockLayout
2668 * @return {Component} this
2670 setDocked : function(dock, layoutParent) {
2674 if (layoutParent && me.ownerCt && me.rendered) {
2675 me.ownerCt.doComponentLayout();
2680 onDestroy : function() {
2683 if (me.monitorResize && Ext.EventManager.resizeEvent) {
2684 Ext.EventManager.resizeEvent.removeListener(me.setSize, me);
2686 Ext.destroy(me.componentLayout, me.loadMask);
2689 <span id='Ext-AbstractComponent-method-destroy'> /**
2690 </span> * Destroys the Component.
2692 destroy : function() {
2695 if (!me.isDestroyed) {
2696 if (me.fireEvent('beforedestroy', me) !== false) {
2697 me.destroying = true;
2701 delete me.floatParent;
2702 // A zIndexManager is stamped into a *floating* Component when it is added to a Container.
2703 // If it has no zIndexManager at render time, it is assigned to the global Ext.WindowManager instance.
2704 if (me.zIndexManager) {
2705 me.zIndexManager.unregister(me);
2707 } else if (me.ownerCt && me.ownerCt.remove) {
2708 me.ownerCt.remove(me, false);
2717 // Attempt to destroy all plugins
2718 Ext.destroy(me.plugins);
2720 Ext.ComponentManager.unregister(me);
2721 me.fireEvent('destroy', me);
2723 me.mixins.state.destroy.call(me);
2725 me.clearListeners();
2726 me.destroying = false;
2727 me.isDestroyed = true;
2732 <span id='Ext-AbstractComponent-method-getPlugin'> /**
2733 </span> * Retrieves a plugin by its pluginId which has been bound to this
2735 * @returns {Ext.AbstractPlugin} pluginInstance
2737 getPlugin: function(pluginId) {
2739 plugins = this.plugins,
2740 ln = plugins.length;
2741 for (; i < ln; i++) {
2742 if (plugins[i].pluginId === pluginId) {
2748 <span id='Ext-AbstractComponent-method-isDescendantOf'> /**
2749 </span> * Determines whether this component is the descendant of a particular container.
2750 * @param {Ext.Container} container
2751 * @returns {Boolean} isDescendant
2753 isDescendantOf: function(container) {
2754 return !!this.findParentBy(function(p){
2755 return p === container;
2761 prev: 'previousSibling',