1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-AbstractComponent-method-constructor'><span id='Ext-AbstractComponent'>/**
2 </span></span> * @class Ext.AbstractComponent
3 * <p>An abstract base class which provides shared methods for Components across the Sencha product line.</p>
4 * <p>Please refer to sub class's documentation</p>
8 Ext.define('Ext.AbstractComponent', {
10 /* Begin Definitions */
13 observable: 'Ext.util.Observable',
14 animate: 'Ext.util.Animate',
15 state: 'Ext.state.Stateful'
20 'Ext.ComponentManager',
26 'Ext.ComponentLoader',
29 'Ext.layout.component.Auto'
32 // Please remember to add dependencies whenever you use it
33 // I had to fix these many times already
46 getAutoId: function() {
47 return ++Ext.AbstractComponent.AUTO_ID;
50 <span id='Ext-AbstractComponent-cfg-id'> /**
51 </span> * @cfg {String} id
52 * <p>The <b><u>unique id of this component instance</u></b> (defaults to an {@link #getId auto-assigned id}).</p>
53 * <p>It should not be necessary to use this configuration except for singleton objects in your application.
54 * Components created with an id may be accessed globally using {@link Ext#getCmp Ext.getCmp}.</p>
55 * <p>Instead of using assigned ids, use the {@link #itemId} config, and {@link Ext.ComponentQuery ComponentQuery} which
56 * provides selector-based searching for Sencha Components analogous to DOM querying. The {@link Ext.container.Container Container}
57 * class contains {@link Ext.container.Container#down shortcut methods} to query its descendant Components by selector.</p>
58 * <p>Note that this id will also be used as the element id for the containing HTML element
59 * that is rendered to the page for this component. This allows you to write id-based CSS
60 * rules to style the specific instance of this component uniquely, and also to select
61 * sub-elements using this component's id as the parent.</p>
62 * <p><b>Note</b>: to avoid complications imposed by a unique <tt>id</tt> also see <code>{@link #itemId}</code>.</p>
63 * <p><b>Note</b>: to access the container of a Component see <code>{@link #ownerCt}</code>.</p>
66 <span id='Ext-AbstractComponent-cfg-itemId'> /**
67 </span> * @cfg {String} itemId
68 * <p>An <tt>itemId</tt> can be used as an alternative way to get a reference to a component
69 * when no object reference is available. Instead of using an <code>{@link #id}</code> with
70 * {@link Ext}.{@link Ext#getCmp getCmp}, use <code>itemId</code> with
71 * {@link Ext.container.Container}.{@link Ext.container.Container#getComponent getComponent} which will retrieve
72 * <code>itemId</code>'s or <tt>{@link #id}</tt>'s. Since <code>itemId</code>'s are an index to the
73 * container's internal MixedCollection, the <code>itemId</code> is scoped locally to the container --
74 * avoiding potential conflicts with {@link Ext.ComponentManager} which requires a <b>unique</b>
75 * <code>{@link #id}</code>.</p>
76 * <pre><code>
77 var c = new Ext.panel.Panel({ //
78 {@link Ext.Component#height height}: 300,
79 {@link #renderTo}: document.body,
80 {@link Ext.container.Container#layout layout}: 'auto',
81 {@link Ext.container.Container#items items}: [
84 {@link Ext.panel.Panel#title title}: 'Panel 1',
85 {@link Ext.Component#height height}: 150
89 {@link Ext.panel.Panel#title title}: 'Panel 2',
90 {@link Ext.Component#height height}: 150
94 p1 = c.{@link Ext.container.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
95 p2 = p1.{@link #ownerCt}.{@link Ext.container.Container#getComponent getComponent}('p2'); // reference via a sibling
96 * </code></pre>
97 * <p>Also see <tt>{@link #id}</tt>, <code>{@link #query}</code>, <code>{@link #down}</code> and <code>{@link #child}</code>.</p>
98 * <p><b>Note</b>: to access the container of an item see <tt>{@link #ownerCt}</tt>.</p>
101 <span id='Ext-AbstractComponent-property-ownerCt'> /**
102 </span> * This Component's owner {@link Ext.container.Container Container} (defaults to undefined, and is set automatically when
103 * this Component is added to a Container). Read-only.
104 * <p><b>Note</b>: to access items within the Container see <tt>{@link #itemId}</tt>.</p>
105 * @type Ext.Container
109 <span id='Ext-AbstractComponent-cfg-autoEl'> /**
110 </span> * @cfg {Mixed} autoEl
111 * <p>A tag name or {@link Ext.core.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
112 * encapsulate this Component.</p>
113 * <p>You do not normally need to specify this. For the base classes {@link Ext.Component} and {@link Ext.container.Container},
114 * this defaults to <b><tt>'div'</tt></b>. The more complex Sencha classes use a more complex
115 * DOM structure specified by their own {@link #renderTpl}s.</p>
116 * <p>This is intended to allow the developer to create application-specific utility Components encapsulated by
117 * different DOM elements. Example usage:</p><pre><code>
122 src: 'http://www.example.com/example.jpg'
128 html: 'autoEl is cool!'
133 cls: 'ux-unordered-list',
137 html: 'First list item'
140 </code></pre>
143 <span id='Ext-AbstractComponent-cfg-renderTpl'> /**
144 </span> * @cfg {Mixed} renderTpl
145 * <p>An {@link Ext.XTemplate XTemplate} used to create the internal structure inside this Component's
146 * encapsulating {@link #getEl Element}.</p>
147 * <p>You do not normally need to specify this. For the base classes {@link Ext.Component}
148 * and {@link Ext.container.Container}, this defaults to <b><code>null</code></b> which means that they will be initially rendered
149 * with no internal structure; they render their {@link #getEl Element} empty. The more specialized ExtJS and Touch classes
150 * which use a more complex DOM structure, provide their own template definitions.</p>
151 * <p>This is intended to allow the developer to create application-specific utility Components with customized
152 * internal structure.</p>
153 * <p>Upon rendering, any created child elements may be automatically imported into object properties using the
154 * {@link #renderSelectors} option.</p>
158 <span id='Ext-AbstractComponent-cfg-renderSelectors'> /**
159 </span> * @cfg {Object} renderSelectors
161 An object containing properties specifying {@link Ext.DomQuery DomQuery} selectors which identify child elements
162 created by the render process.
164 After the Component's internal structure is rendered according to the {@link #renderTpl}, this object is iterated through,
165 and the found Elements are added as properties to the Component using the `renderSelector` property name.
167 For example, a Component which rendered an image, and description into its element might use the following properties
168 coded into its prototype:
170 renderTpl: '&lt;img src="{imageUrl}" class="x-image-component-img">&lt;div class="x-image-component-desc">{description}&gt;/div&lt;',
173 image: 'img.x-image-component-img',
174 descEl: 'div.x-image-component-desc'
177 After rendering, the Component would have a property <code>image</code> referencing its child `img` Element,
178 and a property `descEl` referencing the `div` Element which contains the description.
183 <span id='Ext-AbstractComponent-cfg-renderTo'> /**
184 </span> * @cfg {Mixed} renderTo
185 * <p>Specify the id of the element, a DOM element or an existing Element that this component
186 * will be rendered into.</p><div><ul>
187 * <li><b>Notes</b> : <ul>
188 * <div class="sub-desc">Do <u>not</u> use this option if the Component is to be a child item of
189 * a {@link Ext.container.Container Container}. It is the responsibility of the
190 * {@link Ext.container.Container Container}'s {@link Ext.container.Container#layout layout manager}
191 * to render and manage its child items.</div>
192 * <div class="sub-desc">When using this config, a call to render() is not required.</div>
193 * </ul></li>
194 * </ul></div>
195 * <p>See <code>{@link #render}</code> also.</p>
198 <span id='Ext-AbstractComponent-cfg-frame'> /**
199 </span> * @cfg {Boolean} frame
200 * <p>Specify as <code>true</code> to have the Component inject framing elements within the Component at render time to
201 * provide a graphical rounded frame around the Component content.</p>
202 * <p>This is only necessary when running on outdated, or non standard-compliant browsers such as Microsoft's Internet Explorer
203 * prior to version 9 which do not support rounded corners natively.</p>
204 * <p>The extra space taken up by this framing is available from the read only property {@link #frameSize}.</p>
207 <span id='Ext-AbstractComponent-property-frameSize'> /**
208 </span> * <p>Read-only property indicating the width of any framing elements which were added within the encapsulating element
209 * to provide graphical, rounded borders. See the {@link #frame} config.</p>
210 * <p> This is an object containing the frame width in pixels for all four sides of the Component containing
211 * the following properties:</p><div class="mdetail-params"><ul>
212 * <li><code>top</code> The width of the top framing element in pixels.</li>
213 * <li><code>right</code> The width of the right framing element in pixels.</li>
214 * <li><code>bottom</code> The width of the bottom framing element in pixels.</li>
215 * <li><code>left</code> The width of the left framing element in pixels.</li>
216 * </ul></div>
217 * @property frameSize
221 <span id='Ext-AbstractComponent-cfg-componentLayout'> /**
222 </span> * @cfg {String/Object} componentLayout
223 * <p>The sizing and positioning of a Component's internal Elements is the responsibility of
224 * the Component's layout manager which sizes a Component's internal structure in response to the Component being sized.</p>
225 * <p>Generally, developers will not use this configuration as all provided Components which need their internal
226 * elements sizing (Such as {@link Ext.form.field.Base input fields}) come with their own componentLayout managers.</p>
227 * <p>The {@link Ext.layout.container.Auto default layout manager} will be used on instances of the base Ext.Component class
228 * which simply sizes the Component's encapsulating element to the height and width specified in the {@link #setSize} method.</p>
231 <span id='Ext-AbstractComponent-cfg-tpl'> /**
232 </span> * @cfg {Mixed} tpl
233 * An <bold>{@link Ext.Template}</bold>, <bold>{@link Ext.XTemplate}</bold>
234 * or an array of strings to form an Ext.XTemplate.
235 * Used in conjunction with the <code>{@link #data}</code> and
236 * <code>{@link #tplWriteMode}</code> configurations.
239 <span id='Ext-AbstractComponent-cfg-data'> /**
240 </span> * @cfg {Mixed} data
241 * The initial set of data to apply to the <code>{@link #tpl}</code> to
242 * update the content area of the Component.
245 <span id='Ext-AbstractComponent-cfg-tplWriteMode'> /**
246 </span> * @cfg {String} tplWriteMode The Ext.(X)Template method to use when
247 * updating the content area of the Component. Defaults to <code>'overwrite'</code>
248 * (see <code>{@link Ext.XTemplate#overwrite}</code>).
250 tplWriteMode: 'overwrite',
252 <span id='Ext-AbstractComponent-cfg-baseCls'> /**
253 </span> * @cfg {String} baseCls
254 * The base CSS class to apply to this components's element. This will also be prepended to
255 * elements within this component like Panel's body will get a class x-panel-body. This means
256 * that if you create a subclass of Panel, and you want it to get all the Panels styling for the
257 * element and the body, you leave the baseCls x-panel and use componentCls to add specific styling for this
260 baseCls: Ext.baseCSSPrefix + 'component',
262 <span id='Ext-AbstractComponent-cfg-componentCls'> /**
263 </span> * @cfg {String} componentCls
264 * CSS Class to be added to a components root level element to give distinction to it
268 <span id='Ext-AbstractComponent-cfg-cls'> /**
269 </span> * @cfg {String} cls
270 * An optional extra CSS class that will be added to this component's Element (defaults to ''). This can be
271 * useful for adding customized styles to the component or any of its children using standard CSS rules.
274 <span id='Ext-AbstractComponent-cfg-overCls'> /**
275 </span> * @cfg {String} overCls
276 * An optional extra CSS class that will be added to this component's Element when the mouse moves
277 * over the Element, and removed when the mouse moves out. (defaults to ''). This can be
278 * useful for adding customized 'active' or 'hover' styles to the component or any of its children using standard CSS rules.
281 <span id='Ext-AbstractComponent-cfg-disabledCls'> /**
282 </span> * @cfg {String} disabledCls
283 * CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
285 disabledCls: Ext.baseCSSPrefix + 'item-disabled',
287 <span id='Ext-AbstractComponent-cfg-ui'> /**
288 </span> * @cfg {String/Array} ui
289 * A set style for a component. Can be a string or an Array of multiple strings (UIs)
293 <span id='Ext-AbstractComponent-cfg-uiCls'> /**
294 </span> * @cfg {Array} uiCls
295 * An array of of classNames which are currently applied to this component
300 <span id='Ext-AbstractComponent-cfg-style'> /**
301 </span> * @cfg {String} style
302 * A custom style specification to be applied to this component's Element. Should be a valid argument to
303 * {@link Ext.core.Element#applyStyles}.
304 * <pre><code>
305 new Ext.panel.Panel({
307 renderTo: Ext.getBody(),
308 width: 400, height: 300,
317 new Ext.button.Button({
326 </code></pre>
329 <span id='Ext-AbstractComponent-cfg-width'> /**
330 </span> * @cfg {Number} width
331 * The width of this component in pixels.
334 <span id='Ext-AbstractComponent-cfg-height'> /**
335 </span> * @cfg {Number} height
336 * The height of this component in pixels.
339 <span id='Ext-AbstractComponent-cfg-border'> /**
340 </span> * @cfg {Number/String} border
341 * Specifies the border for this component. The border can be a single numeric value to apply to all sides or
342 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
345 <span id='Ext-AbstractComponent-cfg-padding'> /**
346 </span> * @cfg {Number/String} padding
347 * Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or
348 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
351 <span id='Ext-AbstractComponent-cfg-margin'> /**
352 </span> * @cfg {Number/String} margin
353 * Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or
354 * it can be a CSS style specification for each style, for example: '10 5 3 10'.
357 <span id='Ext-AbstractComponent-cfg-hidden'> /**
358 </span> * @cfg {Boolean} hidden
363 <span id='Ext-AbstractComponent-cfg-disabled'> /**
364 </span> * @cfg {Boolean} disabled
369 <span id='Ext-AbstractComponent-cfg-draggable'> /**
370 </span> * @cfg {Boolean} draggable
371 * Allows the component to be dragged.
374 <span id='Ext-AbstractComponent-property-draggable'> /**
375 </span> * Read-only property indicating whether or not the component can be dragged
376 * @property draggable
381 <span id='Ext-AbstractComponent-cfg-floating'> /**
382 </span> * @cfg {Boolean} floating
383 * Create the Component as a floating and use absolute positioning.
388 <span id='Ext-AbstractComponent-cfg-hideMode'> /**
389 </span> * @cfg {String} hideMode
390 * A String which specifies how this Component's encapsulating DOM element will be hidden.
391 * Values may be<div class="mdetail-params"><ul>
392 * <li><code>'display'</code> : The Component will be hidden using the <code>display: none</code> style.</li>
393 * <li><code>'visibility'</code> : The Component will be hidden using the <code>visibility: hidden</code> style.</li>
394 * <li><code>'offsets'</code> : The Component will be hidden by absolutely positioning it out of the visible area of the document. This
395 * is useful when a hidden Component must maintain measurable dimensions. Hiding using <code>display</code> results
396 * in a Component having zero dimensions.</li></ul></div>
397 * Defaults to <code>'display'</code>.
401 <span id='Ext-AbstractComponent-cfg-contentEl'> /**
402 </span> * @cfg {String} contentEl
403 * <p>Optional. Specify an existing HTML element, or the <code>id</code> of an existing HTML element to use as the content
404 * for this component.</p>
406 * <li><b>Description</b> :
407 * <div class="sub-desc">This config option is used to take an existing HTML element and place it in the layout element
408 * 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>
409 * <li><b>Notes</b> :
410 * <div class="sub-desc">The specified HTML element is appended to the layout element of the component <i>after any configured
411 * {@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>
412 * <div class="sub-desc">The specified HTML element used will not participate in any <code><b>{@link Ext.container.Container#layout layout}</b></code>
413 * 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>
414 * <div class="sub-desc">Add either the <code>x-hidden</code> or the <code>x-hide-display</code> CSS class to
415 * prevent a brief flicker of the content before it is rendered to the panel.</div></li>
419 <span id='Ext-AbstractComponent-cfg-html'> /**
420 </span> * @cfg {String/Object} html
421 * An HTML fragment, or a {@link Ext.core.DomHelper DomHelper} specification to use as the layout element
422 * content (defaults to ''). The HTML content is added after the component is rendered,
423 * so the document will not contain this HTML at the time the {@link #render} event is fired.
424 * This content is inserted into the body <i>before</i> any configured {@link #contentEl} is appended.
427 <span id='Ext-AbstractComponent-cfg-styleHtmlContent'> /**
428 </span> * @cfg {String} styleHtmlContent
429 * True to automatically style the html inside the content target of this component (body for panels).
432 styleHtmlContent: false,
434 <span id='Ext-AbstractComponent-cfg-styleHtmlCls'> /**
435 </span> * @cfg {String} styleHtmlCls
436 * The class that is added to the content target when you set styleHtmlContent to true.
437 * Defaults to 'x-html'
439 styleHtmlCls: Ext.baseCSSPrefix + 'html',
441 <span id='Ext-AbstractComponent-cfg-minHeight'> /**
442 </span> * @cfg {Number} minHeight
443 * <p>The minimum value in pixels which this Component will set its height to.</p>
444 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
446 <span id='Ext-AbstractComponent-cfg-minWidth'> /**
447 </span> * @cfg {Number} minWidth
448 * <p>The minimum value in pixels which this Component will set its width to.</p>
449 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
451 <span id='Ext-AbstractComponent-cfg-maxHeight'> /**
452 </span> * @cfg {Number} maxHeight
453 * <p>The maximum value in pixels which this Component will set its height to.</p>
454 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
456 <span id='Ext-AbstractComponent-cfg-maxWidth'> /**
457 </span> * @cfg {Number} maxWidth
458 * <p>The maximum value in pixels which this Component will set its width to.</p>
459 * <p><b>Warning:</b> This will override any size management applied by layout managers.</p>
462 <span id='Ext-AbstractComponent-cfg-loader'> /**
463 </span> * @cfg {Ext.ComponentLoader/Object} loader
464 * A configuration object or an instance of a {@link Ext.ComponentLoader} to load remote
465 * content for this Component.
471 <span id='Ext-AbstractComponent-cfg-autoShow'> /**
472 </span> * @cfg {Boolean} autoShow True to automatically show the component upon creation.
473 * This config option may only be used for {@link #floating} components or components
474 * that use {@link #autoRender}. Defaults to <tt>false</tt>.
478 <span id='Ext-AbstractComponent-cfg-autoRender'> /**
479 </span> * @cfg {Mixed} autoRender
480 * <p>This config is intended mainly for {@link #floating} Components which may or may not be shown. Instead
481 * of using {@link #renderTo} in the configuration, and rendering upon construction, this allows a Component
482 * to render itself upon first <i>{@link #show}</i>.</p>
483 * <p>Specify as <code>true</code> to have this Component render to the document body upon first show.</p>
484 * <p>Specify as an element, or the ID of an element to have this Component render to a specific element upon first show.</p>
485 * <p><b>This defaults to <code>true</code> for the {@link Ext.window.Window Window} class.</b></p>
491 <span id='Ext-AbstractComponent-cfg-plugins'> /**
492 </span> * @cfg {Object/Array} plugins
493 * An object or array of objects that will provide custom functionality for this component. The only
494 * requirement for a valid plugin is that it contain an init method that accepts a reference of type Ext.Component.
495 * When a component is created, if any plugins are available, the component will call the init method on each
496 * plugin, passing a reference to itself. Each plugin can then call methods or respond to events on the
497 * component as needed to provide its functionality.
500 <span id='Ext-AbstractComponent-property-rendered'> /**
501 </span> * Read-only property indicating whether or not the component has been rendered.
509 trimRe: /^\s+|\s+$/g,
513 <span id='Ext-AbstractComponent-property-maskOnDisable'> /**
514 </span> * This is an internal flag that you use when creating custom components.
515 * By default this is set to true which means that every component gets a mask when its disabled.
516 * Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false
517 * since they want to implement custom disable logic.
518 * @property maskOnDisable
523 constructor : function(config) {
527 config = config || {};
528 me.initialConfig = config;
529 Ext.apply(me, config);
532 <span id='Ext-AbstractComponent-event-beforeactivate'> /**
533 </span> * @event beforeactivate
534 * Fires before a Component has been visually activated.
535 * Returning false from an event listener can prevent the activate
537 * @param {Ext.Component} this
540 <span id='Ext-AbstractComponent-event-activate'> /**
541 </span> * @event activate
542 * Fires after a Component has been visually activated.
543 * @param {Ext.Component} this
546 <span id='Ext-AbstractComponent-event-beforedeactivate'> /**
547 </span> * @event beforedeactivate
548 * Fires before a Component has been visually deactivated.
549 * Returning false from an event listener can prevent the deactivate
551 * @param {Ext.Component} this
554 <span id='Ext-AbstractComponent-event-deactivate'> /**
555 </span> * @event deactivate
556 * Fires after a Component has been visually deactivated.
557 * @param {Ext.Component} this
560 <span id='Ext-AbstractComponent-event-added'> /**
561 </span> * @event added
562 * Fires after a Component had been added to a Container.
563 * @param {Ext.Component} this
564 * @param {Ext.container.Container} container Parent Container
565 * @param {Number} pos position of Component
568 <span id='Ext-AbstractComponent-event-disable'> /**
569 </span> * @event disable
570 * Fires after the component is disabled.
571 * @param {Ext.Component} this
574 <span id='Ext-AbstractComponent-event-enable'> /**
575 </span> * @event enable
576 * Fires after the component is enabled.
577 * @param {Ext.Component} this
580 <span id='Ext-AbstractComponent-event-beforeshow'> /**
581 </span> * @event beforeshow
582 * Fires before the component is shown when calling the {@link #show} method.
583 * Return false from an event handler to stop the show.
584 * @param {Ext.Component} this
587 <span id='Ext-AbstractComponent-event-show'> /**
588 </span> * @event show
589 * Fires after the component is shown when calling the {@link #show} method.
590 * @param {Ext.Component} this
593 <span id='Ext-AbstractComponent-event-beforehide'> /**
594 </span> * @event beforehide
595 * Fires before the component is hidden when calling the {@link #hide} method.
596 * Return false from an event handler to stop the hide.
597 * @param {Ext.Component} this
600 <span id='Ext-AbstractComponent-event-hide'> /**
601 </span> * @event hide
602 * Fires after the component is hidden.
603 * Fires after the component is hidden when calling the {@link #hide} method.
604 * @param {Ext.Component} this
607 <span id='Ext-AbstractComponent-event-removed'> /**
608 </span> * @event removed
609 * Fires when a component is removed from an Ext.container.Container
610 * @param {Ext.Component} this
611 * @param {Ext.container.Container} ownerCt Container which holds the component
614 <span id='Ext-AbstractComponent-event-beforerender'> /**
615 </span> * @event beforerender
616 * Fires before the component is {@link #rendered}. Return false from an
617 * event handler to stop the {@link #render}.
618 * @param {Ext.Component} this
621 <span id='Ext-AbstractComponent-event-render'> /**
622 </span> * @event render
623 * Fires after the component markup is {@link #rendered}.
624 * @param {Ext.Component} this
627 <span id='Ext-AbstractComponent-event-afterrender'> /**
628 </span> * @event afterrender
629 * <p>Fires after the component rendering is finished.</p>
630 * <p>The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed
631 * by any afterRender method defined for the Component.</p>
632 * @param {Ext.Component} this
635 <span id='Ext-AbstractComponent-event-beforedestroy'> /**
636 </span> * @event beforedestroy
637 * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the {@link #destroy}.
638 * @param {Ext.Component} this
641 <span id='Ext-AbstractComponent-event-destroy'> /**
642 </span> * @event destroy
643 * Fires after the component is {@link #destroy}ed.
644 * @param {Ext.Component} this
647 <span id='Ext-AbstractComponent-event-resize'> /**
648 </span> * @event resize
649 * Fires after the component is resized.
650 * @param {Ext.Component} this
651 * @param {Number} adjWidth The box-adjusted width that was set
652 * @param {Number} adjHeight The box-adjusted height that was set
655 <span id='Ext-AbstractComponent-event-move'> /**
656 </span> * @event move
657 * Fires after the component is moved.
658 * @param {Ext.Component} this
659 * @param {Number} x The new x position
660 * @param {Number} y The new y position
668 me.additionalCls = [];
669 me.renderData = me.renderData || {};
670 me.renderSelectors = me.renderSelectors || {};
673 me.plugins = [].concat(me.plugins);
674 for (i = 0, len = me.plugins.length; i < len; i++) {
675 me.plugins[i] = me.constructPlugin(me.plugins[i]);
681 // ititComponent gets a chance to change the id property before registering
682 Ext.ComponentManager.register(me);
684 // Dont pass the config so that it is not applied to 'this' again
685 me.mixins.observable.constructor.call(me);
686 me.mixins.state.constructor.call(me, config);
688 // Move this into Observable?
690 me.plugins = [].concat(me.plugins);
691 for (i = 0, len = me.plugins.length; i < len; i++) {
692 me.plugins[i] = me.initPlugin(me.plugins[i]);
696 me.loader = me.getLoader();
699 me.render(me.renderTo);
707 if (Ext.isDefined(me.disabledClass)) {
708 if (Ext.isDefined(Ext.global.console)) {
709 Ext.global.console.warn('Ext.Component: disabledClass has been deprecated. Please use disabledCls.');
711 me.disabledCls = me.disabledClass;
712 delete me.disabledClass;
717 initComponent: Ext.emptyFn,
721 animate: function(animObj) {
725 animObj = animObj || {};
726 to = animObj.to || {};
728 if (Ext.fx.Manager.hasFxBlock(me.id)) {
731 // Special processing for animating Component dimensions.
732 if (!animObj.dynamic && (to.height || to.width)) {
733 var curWidth = me.getWidth(),
735 curHeight = me.getHeight(),
739 if (to.height && to.height > curHeight) {
743 if (to.width && to.width > curWidth) {
748 // If any dimensions are being increased, we must resize the internal structure
749 // of the Component, but then clip it by sizing its encapsulating element back to original dimensions.
750 // The animation will then progressively reveal the larger content.
752 var clearWidth = !Ext.isNumber(me.width),
753 clearHeight = !Ext.isNumber(me.height);
755 me.componentLayout.childrenChanged = true;
756 me.setSize(w, h, me.ownerCt);
757 me.el.setSize(curWidth, curHeight);
766 return me.mixins.animate.animate.apply(me, arguments);
769 <span id='Ext-AbstractComponent-method-findLayoutController'> /**
770 </span> * <p>This method finds the topmost active layout who's processing will eventually determine the size and position of this
771 * Component.<p>
772 * <p>This method is useful when dynamically adding Components into Containers, and some processing must take place after the
773 * final sizing and positioning of the Component has been performed.</p>
776 findLayoutController: function() {
777 return this.findParentBy(function(c) {
778 // Return true if we are at the root of the Container tree
779 // or this Container's layout is busy but the next one up is not.
780 return !c.ownerCt || (c.layout.layoutBusy && !c.ownerCt.layout.layoutBusy);
784 onShow : function() {
786 var needsLayout = this.needsLayout;
787 if (Ext.isObject(needsLayout)) {
788 this.doComponentLayout(needsLayout.width, needsLayout.height, needsLayout.isSetSize, needsLayout.ownerCt);
792 constructPlugin: function(plugin) {
793 if (plugin.ptype && typeof plugin.init != 'function') {
795 plugin = Ext.PluginManager.create(plugin);
797 else if (typeof plugin == 'string') {
798 plugin = Ext.PluginManager.create({
808 initPlugin : function(plugin) {
814 <span id='Ext-AbstractComponent-method-doAutoRender'> /**
815 </span> * Handles autoRender.
816 * Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that
817 * ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body
819 doAutoRender: function() {
822 me.render(document.body);
824 me.render(Ext.isBoolean(me.autoRender) ? Ext.getBody() : me.autoRender);
829 render : function(container, position) {
832 if (!me.rendered && me.fireEvent('beforerender', me) !== false) {
833 // If this.el is defined, we want to make sure we are dealing with
836 me.el = Ext.get(me.el);
839 // Perform render-time processing for floating Components
844 container = me.initContainer(container);
846 me.onRender(container, position);
848 // Tell the encapsulating element to hide itself in the way the Component is configured to hide
849 // This means DISPLAY, VISIBILITY or OFFSETS.
850 me.el.setVisibilityMode(Ext.core.Element[me.hideMode.toUpperCase()]);
853 me.el.hover(me.addOverCls, me.removeOverCls, me);
856 me.fireEvent('render', me);
860 me.afterRender(container);
861 me.fireEvent('afterrender', me);
866 // Hiding during the render process should not perform any ancillary
867 // actions that the full hide process does; It is not hiding, it begins in a hidden state.'
868 // So just make the element hidden according to the configured hideMode
873 // pass silent so the event doesn't fire the first time.
881 onRender : function(container, position) {
885 styles = me.initStyles(),
886 renderTpl, renderData, i;
888 position = me.getInsertPosition(position);
892 el = Ext.core.DomHelper.insertBefore(position, me.getElConfig(), true);
895 el = Ext.core.DomHelper.append(container, me.getElConfig(), true);
898 else if (me.allowDomMove !== false) {
900 container.dom.insertBefore(el.dom, position);
902 container.dom.appendChild(el.dom);
906 if (Ext.scopeResetCSS && !me.ownerCt) {
907 // If this component's el is the body element, we add the reset class to the html tag
908 if (el.dom == Ext.getBody().dom) {
909 el.parent().addCls(Ext.baseCSSPrefix + 'reset');
912 // Else we wrap this element in an element that adds the reset class.
913 me.resetEl = el.wrap({
914 cls: Ext.baseCSSPrefix + 'reset'
922 // Here we check if the component has a height set through style or css.
923 // If it does then we set the this.height to that value and it won't be
924 // considered an auto height component
925 // if (this.height === undefined) {
926 // var height = el.getHeight();
927 // // This hopefully means that the panel has an explicit height set in style or css
928 // if (height - el.getPadding('tb') - el.getBorderWidth('tb') > 0) {
929 // this.height = height;
936 me.addUIToElement(true);
937 //loop through all exisiting uiCls and update the ui in them
938 for (i = 0; i < me.uiCls.length; i++) {
939 me.addUIClsToElement(me.uiCls[i], true);
944 renderTpl = me.initRenderTpl();
946 renderData = me.initRenderData();
947 renderTpl.append(me.getTargetEl(), renderData);
950 me.applyRenderSelectors();
958 afterRender : function() {
963 me.getComponentLayout();
965 // Set the size if a size is configured, or if this is the outermost Container
966 if (!me.ownerCt || (me.height || me.width)) {
967 me.setSize(me.width, me.height);
970 // For floaters, calculate x and y if they aren't defined by aligning
971 // the sized element to the center of either the the container or the ownerCt
972 if (me.floating && (me.x === undefined || me.y === undefined)) {
973 if (me.floatParent) {
974 xy = me.el.getAlignToXY(me.floatParent.getTargetEl(), 'c-c');
975 pos = me.floatParent.getTargetEl().translatePoints(xy[0], xy[1]);
977 xy = me.el.getAlignToXY(me.container, 'c-c');
978 pos = me.container.translatePoints(xy[0], xy[1]);
980 me.x = me.x === undefined ? pos.left: me.x;
981 me.y = me.y === undefined ? pos.top: me.y;
984 if (Ext.isDefined(me.x) || Ext.isDefined(me.y)) {
985 me.setPosition(me.x, me.y);
988 if (me.styleHtmlContent) {
989 me.getTargetEl().addCls(me.styleHtmlCls);
993 frameCls: Ext.baseCSSPrefix + 'frame',
996 '<tpl if="top">',
997 '<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>',
998 '<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>',
999 '<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>',
1000 '<tpl if="right"></div></tpl>',
1001 '<tpl if="left"></div></tpl>',
1003 '<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>',
1004 '<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>',
1005 '<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>',
1006 '<tpl if="right"></div></tpl>',
1007 '<tpl if="left"></div></tpl>',
1008 '<tpl if="bottom">',
1009 '<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>',
1010 '<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>',
1011 '<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>',
1012 '<tpl if="right"></div></tpl>',
1013 '<tpl if="left"></div></tpl>',
1018 '<table><tbody>',
1019 '<tpl if="top">',
1021 '<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>',
1022 '<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>',
1023 '<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>',
1027 '<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>',
1028 '<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>',
1029 '<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>',
1031 '<tpl if="bottom">',
1033 '<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>',
1034 '<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>',
1035 '<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>',
1038 '</tbody></table>'
1041 <span id='Ext-AbstractComponent-method-initFrame'> /**
1044 initFrame : function() {
1045 if (Ext.supports.CSS3BorderRadius) {
1050 frameInfo = me.getFrameInfo(),
1051 frameWidth = frameInfo.width,
1052 frameTpl = me.getFrameTpl(frameInfo.table);
1055 // Here we render the frameTpl to this component. This inserts the 9point div or the table framing.
1056 frameTpl.insertFirst(me.el, Ext.apply({}, {
1059 frameCls: me.frameCls,
1060 baseCls: me.baseCls,
1061 frameWidth: frameWidth,
1062 top: !!frameInfo.top,
1063 left: !!frameInfo.left,
1064 right: !!frameInfo.right,
1065 bottom: !!frameInfo.bottom
1066 }, me.getFramePositions(frameInfo)));
1068 // The frameBody is returned in getTargetEl, so that layouts render items to the correct target.=
1069 me.frameBody = me.el.down('.' + me.frameCls + '-mc');
1071 // Add the render selectors for each of the frame elements
1072 Ext.apply(me.renderSelectors, {
1073 frameTL: '.' + me.baseCls + '-tl',
1074 frameTC: '.' + me.baseCls + '-tc',
1075 frameTR: '.' + me.baseCls + '-tr',
1076 frameML: '.' + me.baseCls + '-ml',
1077 frameMC: '.' + me.baseCls + '-mc',
1078 frameMR: '.' + me.baseCls + '-mr',
1079 frameBL: '.' + me.baseCls + '-bl',
1080 frameBC: '.' + me.baseCls + '-bc',
1081 frameBR: '.' + me.baseCls + '-br'
1086 updateFrame: function() {
1087 if (Ext.supports.CSS3BorderRadius) {
1092 wasTable = this.frameSize && this.frameSize.table,
1093 oldFrameTL = this.frameTL,
1094 oldFrameBL = this.frameBL,
1095 oldFrameML = this.frameML,
1096 oldFrameMC = this.frameMC,
1103 // Reapply render selectors
1113 this.applyRenderSelectors();
1115 // Store the class names set on the new mc
1116 newMCClassName = this.frameMC.dom.className;
1118 // Replace the new mc with the old mc
1119 oldFrameMC.insertAfter(this.frameMC);
1120 this.frameMC.remove();
1122 // Restore the reference to the old frame mc as the framebody
1123 this.frameBody = this.frameMC = oldFrameMC;
1125 // Apply the new mc classes to the old mc element
1126 oldFrameMC.dom.className = newMCClassName;
1128 // Remove the old framing
1130 me.el.query('> table')[1].remove();
1134 oldFrameTL.remove();
1137 oldFrameBL.remove();
1139 oldFrameML.remove();
1143 // We were framed but not anymore. Move all content from the old frame to the body
1147 else if (me.frame) {
1148 this.applyRenderSelectors();
1152 getFrameInfo: function() {
1153 if (Ext.supports.CSS3BorderRadius) {
1158 left = me.el.getStyle('background-position-x'),
1159 top = me.el.getStyle('background-position-y'),
1160 info, frameInfo = false, max;
1162 // Some browsers dont support background-position-x and y, so for those
1163 // browsers let's split background-position into two parts.
1164 if (!left && !top) {
1165 info = me.el.getStyle('background-position').split(' ');
1170 // We actually pass a string in the form of '[type][tl][tr]px [type][br][bl]px' as
1171 // the background position of this.el from the css to indicate to IE that this component needs
1172 // framing. We parse it here and change the markup accordingly.
1173 if (parseInt(left, 10) >= 1000000 && parseInt(top, 10) >= 1000000) {
1177 // Table markup starts with 110, div markup with 100.
1178 table: left.substr(0, 3) == '110',
1180 // Determine if we are dealing with a horizontal or vertical component
1181 vertical: top.substr(0, 3) == '110',
1183 // Get and parse the different border radius sizes
1184 top: max(left.substr(3, 2), left.substr(5, 2)),
1185 right: max(left.substr(5, 2), top.substr(3, 2)),
1186 bottom: max(top.substr(3, 2), top.substr(5, 2)),
1187 left: max(top.substr(5, 2), left.substr(3, 2))
1190 frameInfo.width = max(frameInfo.top, frameInfo.right, frameInfo.bottom, frameInfo.left);
1192 // Just to be sure we set the background image of the el to none.
1193 me.el.setStyle('background-image', 'none');
1196 // This happens when you set frame: true explicitly without using the x-frame mixin in sass.
1197 // This way IE can't figure out what sizes to use and thus framing can't work.
1198 if (me.frame === true && !frameInfo) {
1199 //<debug error>
1200 Ext.Error.raise("You have set frame: true explicity on this component while it doesn't have any " +
1201 "framing defined in the CSS template. In this case IE can't figure out what sizes " +
1202 "to use and thus framing on this component will be disabled.");
1206 me.frame = me.frame || !!frameInfo;
1207 me.frameSize = frameInfo || false;
1212 getFramePositions: function(frameInfo) {
1214 frameWidth = frameInfo.width,
1216 positions, tc, bc, ml, mr;
1218 if (frameInfo.vertical) {
1219 tc = '0 -' + (frameWidth * 0) + 'px';
1220 bc = '0 -' + (frameWidth * 1) + 'px';
1222 if (dock && dock == "right") {
1223 tc = 'right -' + (frameWidth * 0) + 'px';
1224 bc = 'right -' + (frameWidth * 1) + 'px';
1228 tl: '0 -' + (frameWidth * 0) + 'px',
1229 tr: '0 -' + (frameWidth * 1) + 'px',
1230 bl: '0 -' + (frameWidth * 2) + 'px',
1231 br: '0 -' + (frameWidth * 3) + 'px',
1233 ml: '-' + (frameWidth * 1) + 'px 0',
1240 ml = '-' + (frameWidth * 0) + 'px 0';
1243 if (dock && dock == "bottom") {
1245 mr = 'right bottom';
1249 tl: '0 -' + (frameWidth * 2) + 'px',
1250 tr: 'right -' + (frameWidth * 3) + 'px',
1251 bl: '0 -' + (frameWidth * 4) + 'px',
1252 br: 'right -' + (frameWidth * 5) + 'px',
1257 tc: '0 -' + (frameWidth * 0) + 'px',
1258 bc: '0 -' + (frameWidth * 1) + 'px'
1265 <span id='Ext-AbstractComponent-method-getFrameTpl'> /**
1268 getFrameTpl : function(table) {
1269 return table ? this.getTpl('frameTableTpl') : this.getTpl('frameTpl');
1272 <span id='Ext-AbstractComponent-method-initCls'> /**
1273 </span> * <p>Creates an array of class names from the configurations to add to this Component's <code>el</code> on render.</p>
1274 * <p>Private, but (possibly) used by ComponentQuery for selection by class name if Component is not rendered.</p>
1275 * @return {Array} An array of class names with which the Component's element will be rendered.
1278 initCls: function() {
1282 cls.push(me.baseCls);
1284 //<deprecated since=0.99>
1285 if (Ext.isDefined(me.cmpCls)) {
1286 if (Ext.isDefined(Ext.global.console)) {
1287 Ext.global.console.warn('Ext.Component: cmpCls has been deprecated. Please use componentCls.');
1289 me.componentCls = me.cmpCls;
1292 //</deprecated>
1294 if (me.componentCls) {
1295 cls.push(me.componentCls);
1297 me.componentCls = me.baseCls;
1304 return cls.concat(me.additionalCls);
1307 <span id='Ext-AbstractComponent-method-setUI'> /**
1308 </span> * Sets the UI for the component. This will remove any existing UIs on the component. It will also
1309 * loop through any uiCls set on the component and rename them so they include the new UI
1310 * @param {String} ui The new UI for the component
1312 setUI: function(ui) {
1314 oldUICls = Ext.Array.clone(me.uiCls),
1319 //loop through all exisiting uiCls and update the ui in them
1320 for (i = 0; i < oldUICls.length; i++) {
1323 me.removeClsWithUI(cls);
1327 //remove the UI from the element
1328 me.removeUIFromElement();
1333 //add the new UI to the elemend
1334 me.addUIToElement();
1336 //loop through all exisiting uiCls and update the ui in them
1337 for (i = 0; i < newUICls.length; i++) {
1340 me.addClsWithUI(cls);
1344 <span id='Ext-AbstractComponent-method-addClsWithUI'> /**
1345 </span> * Adds a cls to the uiCls array, which will also call {@link #addUIClsToElement} and adds
1346 * to all elements of this component.
1347 * @param {String/Array} cls A string or an array of strings to add to the uiCls
1349 addClsWithUI: function(cls) {
1353 if (!Ext.isArray(cls)) {
1357 for (i = 0; i < cls.length; i++) {
1358 if (cls[i] && !me.hasUICls(cls[i])) {
1359 me.uiCls = Ext.Array.clone(me.uiCls);
1360 me.uiCls.push(cls[i]);
1361 me.addUIClsToElement(cls[i]);
1366 <span id='Ext-AbstractComponent-method-removeClsWithUI'> /**
1367 </span> * Removes a cls to the uiCls array, which will also call {@link #removeUIClsToElement} and removes
1368 * it from all elements of this component.
1369 * @param {String/Array} cls A string or an array of strings to remove to the uiCls
1371 removeClsWithUI: function(cls) {
1375 if (!Ext.isArray(cls)) {
1379 for (i = 0; i < cls.length; i++) {
1380 if (cls[i] && me.hasUICls(cls[i])) {
1381 me.uiCls = Ext.Array.remove(me.uiCls, cls[i]);
1382 me.removeUIClsFromElement(cls[i]);
1387 <span id='Ext-AbstractComponent-method-hasUICls'> /**
1388 </span> * Checks if there is currently a specified uiCls
1389 * @param {String} cls The cls to check
1391 hasUICls: function(cls) {
1393 uiCls = me.uiCls || [];
1395 return Ext.Array.contains(uiCls, cls);
1398 <span id='Ext-AbstractComponent-method-addUIClsToElement'> /**
1399 </span> * Method which adds a specified UI + uiCls to the components element.
1400 * Can be overridden to remove the UI from more than just the components element.
1401 * @param {String} ui The UI to remove from the element
1404 addUIClsToElement: function(cls, force) {
1407 me.addCls(Ext.baseCSSPrefix + cls);
1408 me.addCls(me.baseCls + '-' + cls);
1409 me.addCls(me.baseCls + '-' + me.ui + '-' + cls);
1411 if (!force && me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1412 // define each element of the frame
1413 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1416 // loop through each of them, and if they are defined add the ui
1417 for (i = 0; i < els.length; i++) {
1418 el = me['frame' + els[i].toUpperCase()];
1420 if (el && el.dom) {
1421 el.addCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1422 el.addCls(me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i]);
1428 <span id='Ext-AbstractComponent-method-removeUIClsFromElement'> /**
1429 </span> * Method which removes a specified UI + uiCls from the components element.
1430 * The cls which is added to the element will be: `this.baseCls + '-' + ui`
1431 * @param {String} ui The UI to add to the element
1434 removeUIClsFromElement: function(cls, force) {
1437 me.removeCls(Ext.baseCSSPrefix + cls);
1438 me.removeCls(me.baseCls + '-' + cls);
1439 me.removeCls(me.baseCls + '-' + me.ui + '-' + cls);
1441 if (!force &&me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1442 // define each element of the frame
1443 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1446 // loop through each of them, and if they are defined add the ui
1447 for (i = 0; i < els.length; i++) {
1448 el = me['frame' + els[i].toUpperCase()];
1449 if (el && el.dom) {
1450 el.removeCls(me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i]);
1456 <span id='Ext-AbstractComponent-method-addUIToElement'> /**
1457 </span> * Method which adds a specified UI to the components element.
1460 addUIToElement: function(force) {
1463 me.addCls(me.baseCls + '-' + me.ui);
1465 if (me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1466 // define each element of the frame
1467 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1470 // loop through each of them, and if they are defined add the ui
1471 for (i = 0; i < els.length; i++) {
1472 el = me['frame' + els[i].toUpperCase()];
1475 el.addCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1481 <span id='Ext-AbstractComponent-method-removeUIFromElement'> /**
1482 </span> * Method which removes a specified UI from the components element.
1485 removeUIFromElement: function() {
1488 me.removeCls(me.baseCls + '-' + me.ui);
1490 if (me.rendered && me.frame && !Ext.supports.CSS3BorderRadius) {
1491 // define each element of the frame
1492 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1495 // loop through each of them, and if they are defined add the ui
1496 for (i = 0; i < els.length; i++) {
1497 el = me['frame' + els[i].toUpperCase()];
1499 el.removeCls(me.baseCls + '-' + me.ui + '-' + els[i]);
1505 getElConfig : function() {
1506 var result = this.autoEl || {tag: 'div'};
1507 result.id = this.id;
1511 <span id='Ext-AbstractComponent-method-getInsertPosition'> /**
1512 </span> * This function takes the position argument passed to onRender and returns a
1513 * DOM element that you can use in the insertBefore.
1514 * @param {String/Number/Element/HTMLElement} position Index, element id or element you want
1515 * to put this component before.
1516 * @return {HTMLElement} DOM element that you can use in the insertBefore
1518 getInsertPosition: function(position) {
1519 // Convert the position to an element to insert before
1520 if (position !== undefined) {
1521 if (Ext.isNumber(position)) {
1522 position = this.container.dom.childNodes[position];
1525 position = Ext.getDom(position);
1532 <span id='Ext-AbstractComponent-method-initContainer'> /**
1533 </span> * Adds ctCls to container.
1534 * @return {Ext.core.Element} The initialized container
1537 initContainer: function(container) {
1540 // If you render a component specifying the el, we get the container
1541 // of the el, and make sure we dont move the el around in the dom
1542 // during the render
1543 if (!container && me.el) {
1544 container = me.el.dom.parentNode;
1545 me.allowDomMove = false;
1548 me.container = Ext.get(container);
1551 me.container.addCls(me.ctCls);
1554 return me.container;
1557 <span id='Ext-AbstractComponent-method-initRenderData'> /**
1558 </span> * Initialized the renderData to be used when rendering the renderTpl.
1559 * @return {Object} Object with keys and values that are going to be applied to the renderTpl
1562 initRenderData: function() {
1565 return Ext.applyIf(me.renderData, {
1568 baseCls: me.baseCls,
1569 componentCls: me.componentCls,
1574 <span id='Ext-AbstractComponent-method-getTpl'> /**
1577 getTpl: function(name) {
1578 var prototype = this.self.prototype,
1581 if (this.hasOwnProperty(name)) {
1582 if (!(this[name] instanceof Ext.XTemplate)) {
1583 this[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', this[name]);
1589 if (!(prototype[name] instanceof Ext.XTemplate)) {
1590 ownerPrototype = prototype;
1593 if (ownerPrototype.hasOwnProperty(name)) {
1594 ownerPrototype[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', ownerPrototype[name]);
1598 ownerPrototype = ownerPrototype.superclass;
1599 } while (ownerPrototype);
1602 return prototype[name];
1605 <span id='Ext-AbstractComponent-method-initRenderTpl'> /**
1606 </span> * Initializes the renderTpl.
1607 * @return {Ext.XTemplate} The renderTpl XTemplate instance.
1610 initRenderTpl: function() {
1611 return this.getTpl('renderTpl');
1614 <span id='Ext-AbstractComponent-method-initStyles'> /**
1615 </span> * Function description
1616 * @return {String} A CSS style string with style, padding, margin and border.
1619 initStyles: function() {
1622 Element = Ext.core.Element;
1624 if (Ext.isString(me.style)) {
1625 style = Element.parseStyles(me.style);
1627 style = Ext.apply({}, me.style);
1630 // Convert the padding, margin and border properties from a space seperated string
1631 // into a proper style string
1632 if (me.padding !== undefined) {
1633 style.padding = Element.unitizeBox((me.padding === true) ? 5 : me.padding);
1636 if (me.margin !== undefined) {
1637 style.margin = Element.unitizeBox((me.margin === true) ? 5 : me.margin);
1644 <span id='Ext-AbstractComponent-method-initContent'> /**
1645 </span> * Initializes this components contents. It checks for the properties
1646 * html, contentEl and tpl/data.
1649 initContent: function() {
1651 target = me.getTargetEl(),
1656 target.update(Ext.core.DomHelper.markup(me.html));
1661 contentEl = Ext.get(me.contentEl);
1662 pre = Ext.baseCSSPrefix;
1663 contentEl.removeCls([pre + 'hidden', pre + 'hide-display', pre + 'hide-offsets', pre + 'hide-nosize']);
1664 target.appendChild(contentEl.dom);
1668 // Make sure this.tpl is an instantiated XTemplate
1669 if (!me.tpl.isTemplate) {
1670 me.tpl = Ext.create('Ext.XTemplate', me.tpl);
1674 me.tpl[me.tplWriteMode](target, me.data);
1681 initEvents : function() {
1683 afterRenderEvents = me.afterRenderEvents,
1684 property, listeners;
1685 if (afterRenderEvents) {
1686 for (property in afterRenderEvents) {
1687 if (afterRenderEvents.hasOwnProperty(property)) {
1688 listeners = afterRenderEvents[property];
1689 if (me[property] && me[property].on) {
1690 me.mon(me[property], listeners);
1697 <span id='Ext-AbstractComponent-method-applyRenderSelectors'> /**
1698 </span> * Sets references to elements inside the component. E.g body -> x-panel-body
1701 applyRenderSelectors: function() {
1702 var selectors = this.renderSelectors || {},
1706 for (selector in selectors) {
1707 if (selectors.hasOwnProperty(selector) && selectors[selector]) {
1708 this[selector] = Ext.get(Ext.DomQuery.selectNode(selectors[selector], el));
1713 <span id='Ext-AbstractComponent-method-is'> /**
1714 </span> * Tests whether this Component matches the selector string.
1715 * @param {String} selector The selector string to test against.
1716 * @return {Boolean} True if this Component matches the selector.
1718 is: function(selector) {
1719 return Ext.ComponentQuery.is(this, selector);
1722 <span id='Ext-AbstractComponent-method-up'> /**
1723 </span> * <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches
1724 * the passed simple selector.</p>
1725 * <p>Example:<pre><code>
1726 var owningTabPanel = grid.up('tabpanel');
1727 </code></pre>
1728 * @param {String} selector Optional. The simple selector to test.
1729 * @return {Container} The matching ancestor Container (or <code>undefined</code> if no match was found).
1731 up: function(selector) {
1732 var result = this.ownerCt;
1734 for (; result; result = result.ownerCt) {
1735 if (Ext.ComponentQuery.is(result, selector)) {
1743 <span id='Ext-AbstractComponent-method-nextSibling'> /**
1744 </span> * <p>Returns the next sibling of this Component.</p>
1745 * <p>Optionally selects the next sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery} selector.</p>
1746 * <p>May also be refered to as <code><b>next()</b></code></p>
1747 * <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>
1748 * @param {String} selector Optional A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following items.
1749 * @returns The next sibling (or the next sibling which matches the selector). Returns null if there is no matching sibling.
1751 nextSibling: function(selector) {
1752 var o = this.ownerCt, it, last, idx, c;
1755 idx = it.indexOf(this) + 1;
1758 for (last = it.getCount(); idx < last; idx++) {
1759 if ((c = it.getAt(idx)).is(selector)) {
1764 if (idx < it.getCount()) {
1765 return it.getAt(idx);
1773 <span id='Ext-AbstractComponent-method-previousSibling'> /**
1774 </span> * <p>Returns the previous sibling of this Component.</p>
1775 * <p>Optionally selects the previous sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery} selector.</p>
1776 * <p>May also be refered to as <code><b>prev()</b></code></p>
1777 * <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>
1778 * @param {String} selector Optional. A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding items.
1779 * @returns The previous sibling (or the previous sibling which matches the selector). Returns null if there is no matching sibling.
1781 previousSibling: function(selector) {
1782 var o = this.ownerCt, it, idx, c;
1785 idx = it.indexOf(this);
1788 for (--idx; idx >= 0; idx--) {
1789 if ((c = it.getAt(idx)).is(selector)) {
1795 return it.getAt(--idx);
1803 <span id='Ext-AbstractComponent-method-previousNode'> /**
1804 </span> * <p>Returns the previous node in the Component tree in tree traversal order.</p>
1805 * <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will
1806 * walk the tree in reverse order to attempt to find a match. Contrast with {@link #previousSibling}.</p>
1807 * @param {String} selector Optional. A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding nodes.
1808 * @returns The previous node (or the previous node which matches the selector). Returns null if there is no matching node.
1810 previousNode: function(selector, includeSelf) {
1815 // If asked to include self, test me
1816 if (includeSelf && node.is(selector)) {
1820 result = this.prev(selector);
1826 for (it = node.ownerCt.items.items, i = Ext.Array.indexOf(it, node) - 1; i > -1; i--) {
1828 result = it[i].query(selector);
1829 result = result[result.length - 1];
1835 return node.ownerCt.previousNode(selector, true);
1839 <span id='Ext-AbstractComponent-method-nextNode'> /**
1840 </span> * <p>Returns the next node in the Component tree in tree traversal order.</p>
1841 * <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will
1842 * walk the tree to attempt to find a match. Contrast with {@link #pnextSibling}.</p>
1843 * @param {String} selector Optional A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following nodes.
1844 * @returns The next node (or the next node which matches the selector). Returns null if there is no matching node.
1846 nextNode: function(selector, includeSelf) {
1851 // If asked to include self, test me
1852 if (includeSelf && node.is(selector)) {
1856 result = this.next(selector);
1862 for (it = node.ownerCt.items, i = it.indexOf(node) + 1, it = it.items, len = it.length; i < len; i++) {
1864 result = it[i].down(selector);
1870 return node.ownerCt.nextNode(selector);
1874 <span id='Ext-AbstractComponent-method-getId'> /**
1875 </span> * Retrieves the id of this component.
1876 * Will autogenerate an id if one has not already been set.
1878 getId : function() {
1879 return this.id || (this.id = 'ext-comp-' + (this.getAutoId()));
1882 getItemId : function() {
1883 return this.itemId || this.id;
1886 <span id='Ext-AbstractComponent-method-getEl'> /**
1887 </span> * Retrieves the top level element representing this component.
1889 getEl : function() {
1893 <span id='Ext-AbstractComponent-method-getTargetEl'> /**
1894 </span> * This is used to determine where to insert the 'html', 'contentEl' and 'items' in this component.
1897 getTargetEl: function() {
1898 return this.frameBody || this.el;
1901 <span id='Ext-AbstractComponent-method-isXType'> /**
1902 </span> * <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
1903 * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p>
1904 * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
1905 * to participate in determination of inherited xtypes.</b></p>
1906 * <p>For a list of all available xtypes, see the {@link Ext.Component} header.</p>
1907 * <p>Example usage:</p>
1908 * <pre><code>
1909 var t = new Ext.form.field.Text();
1910 var isText = t.isXType('textfield'); // true
1911 var isBoxSubclass = t.isXType('field'); // true, descended from Ext.form.field.Base
1912 var isBoxInstance = t.isXType('field', true); // false, not a direct Ext.form.field.Base instance
1913 </code></pre>
1914 * @param {String} xtype The xtype to check for this Component
1915 * @param {Boolean} shallow (optional) False to check whether this Component is descended from the xtype (this is
1916 * the default), or true to check whether this Component is directly of the specified xtype.
1917 * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
1919 isXType: function(xtype, shallow) {
1920 //assume a string by default
1921 if (Ext.isFunction(xtype)) {
1922 xtype = xtype.xtype;
1923 //handle being passed the class, e.g. Ext.Component
1924 } else if (Ext.isObject(xtype)) {
1925 xtype = xtype.statics().xtype;
1926 //handle being passed an instance
1929 return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1: this.self.xtype == xtype;
1932 <span id='Ext-AbstractComponent-method-getXTypes'> /**
1933 </span> * <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all
1934 * available xtypes, see the {@link Ext.Component} header.</p>
1935 * <p><b>If using your own subclasses, be aware that a Component must register its own xtype
1936 * to participate in determination of inherited xtypes.</b></p>
1937 * <p>Example usage:</p>
1938 * <pre><code>
1939 var t = new Ext.form.field.Text();
1940 alert(t.getXTypes()); // alerts 'component/field/textfield'
1941 </code></pre>
1942 * @return {String} The xtype hierarchy string
1944 getXTypes: function() {
1945 var self = this.self,
1947 parentPrototype = this,
1951 while (parentPrototype && Ext.getClass(parentPrototype)) {
1952 xtype = Ext.getClass(parentPrototype).xtype;
1954 if (xtype !== undefined) {
1955 xtypes.unshift(xtype);
1958 parentPrototype = parentPrototype.superclass;
1961 self.xtypeChain = xtypes;
1962 self.xtypes = xtypes.join('/');
1968 <span id='Ext-AbstractComponent-method-update'> /**
1969 </span> * Update the content area of a component.
1970 * @param {Mixed} htmlOrData
1971 * If this component has been configured with a template via the tpl config
1972 * then it will use this argument as data to populate the template.
1973 * If this component was not configured with a template, the components
1974 * content area will be updated via Ext.core.Element update
1975 * @param {Boolean} loadScripts
1976 * (optional) Only legitimate when using the html configuration. Defaults to false
1977 * @param {Function} callback
1978 * (optional) Only legitimate when using the html configuration. Callback to execute when scripts have finished loading
1980 update : function(htmlOrData, loadScripts, cb) {
1983 if (me.tpl && !Ext.isString(htmlOrData)) {
1984 me.data = htmlOrData;
1986 me.tpl[me.tplWriteMode](me.getTargetEl(), htmlOrData || {});
1989 me.html = Ext.isObject(htmlOrData) ? Ext.core.DomHelper.markup(htmlOrData) : htmlOrData;
1991 me.getTargetEl().update(me.html, loadScripts, cb);
1996 me.doComponentLayout();
2000 <span id='Ext-AbstractComponent-method-setVisible'> /**
2001 </span> * Convenience function to hide or show this component by boolean.
2002 * @param {Boolean} visible True to show, false to hide
2003 * @return {Ext.Component} this
2005 setVisible : function(visible) {
2006 return this[visible ? 'show': 'hide']();
2009 <span id='Ext-AbstractComponent-method-isVisible'> /**
2010 </span> * Returns true if this component is visible.
2011 * @param {Boolean} deep. <p>Optional. Pass <code>true</code> to interrogate the visibility status of all
2012 * parent Containers to determine whether this Component is truly visible to the user.</p>
2013 * <p>Generally, to determine whether a Component is hidden, the no argument form is needed. For example
2014 * when creating dynamically laid out UIs in a hidden Container before showing them.</p>
2015 * @return {Boolean} True if this component is visible, false otherwise.
2017 isVisible: function(deep) {
2020 visible = !me.hidden,
2021 ancestor = me.ownerCt;
2023 // Clear hiddenOwnerCt property
2024 me.hiddenAncestor = false;
2029 if (deep && visible && me.rendered && ancestor) {
2031 // If any ancestor is hidden, then this is hidden.
2032 // If an ancestor Panel (only Panels have a collapse method) is collapsed,
2033 // then its layoutTarget (body) is hidden, so this is hidden unless its within a
2034 // docked item; they are still visible when collapsed (Unless they themseves are hidden)
2035 if (ancestor.hidden || (ancestor.collapsed &&
2036 !(ancestor.getDockedItems && Ext.Array.contains(ancestor.getDockedItems(), child)))) {
2037 // Store hiddenOwnerCt property if needed
2038 me.hiddenAncestor = ancestor;
2043 ancestor = ancestor.ownerCt;
2049 <span id='Ext-AbstractComponent-method-enable'> /**
2050 </span> * Enable the component
2051 * @param {Boolean} silent
2052 * Passing false will supress the 'enable' event from being fired.
2054 enable: function(silent) {
2058 me.el.removeCls(me.disabledCls);
2059 me.el.dom.disabled = false;
2063 me.disabled = false;
2065 if (silent !== true) {
2066 me.fireEvent('enable', me);
2072 <span id='Ext-AbstractComponent-method-disable'> /**
2073 </span> * Disable the component.
2074 * @param {Boolean} silent
2075 * Passing true, will supress the 'disable' event from being fired.
2077 disable: function(silent) {
2081 me.el.addCls(me.disabledCls);
2082 me.el.dom.disabled = true;
2088 if (silent !== true) {
2089 me.fireEvent('disable', me);
2096 onEnable: function() {
2097 if (this.maskOnDisable) {
2103 onDisable : function() {
2104 if (this.maskOnDisable) {
2109 <span id='Ext-AbstractComponent-method-isDisabled'> /**
2110 </span> * Method to determine whether this Component is currently disabled.
2111 * @return {Boolean} the disabled state of this Component.
2113 isDisabled : function() {
2114 return this.disabled;
2117 <span id='Ext-AbstractComponent-method-setDisabled'> /**
2118 </span> * Enable or disable the component.
2119 * @param {Boolean} disabled
2121 setDisabled : function(disabled) {
2122 return this[disabled ? 'disable': 'enable']();
2125 <span id='Ext-AbstractComponent-method-isHidden'> /**
2126 </span> * Method to determine whether this Component is currently set to hidden.
2127 * @return {Boolean} the hidden state of this Component.
2129 isHidden : function() {
2133 <span id='Ext-AbstractComponent-method-addCls'> /**
2134 </span> * Adds a CSS class to the top level element representing this component.
2135 * @param {String} cls The CSS class name to add
2136 * @return {Ext.Component} Returns the Component to allow method chaining.
2138 addCls : function(className) {
2143 if (!Ext.isArray(className)){
2144 className = className.replace(me.trimRe, '').split(me.spacesRe);
2147 me.el.addCls(className);
2150 me.additionalCls = Ext.Array.unique(me.additionalCls.concat(className));
2155 <span id='Ext-AbstractComponent-method-addClass'> /**
2156 </span> * @deprecated 4.0 Replaced by {link:#addCls}
2157 * 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 addClass : function() {
2162 return this.addCls.apply(this, arguments);
2165 <span id='Ext-AbstractComponent-method-removeCls'> /**
2166 </span> * Removes a CSS class from the top level element representing this component.
2167 * @returns {Ext.Component} Returns the Component to allow method chaining.
2169 removeCls : function(className) {
2175 if (!Ext.isArray(className)){
2176 className = className.replace(me.trimRe, '').split(me.spacesRe);
2179 me.el.removeCls(className);
2181 else if (me.additionalCls.length) {
2182 Ext.each(className, function(cls) {
2183 Ext.Array.remove(me.additionalCls, cls);
2190 removeClass : function() {
2191 if (Ext.isDefined(Ext.global.console)) {
2192 Ext.global.console.warn('Ext.Component: removeClass has been deprecated. Please use removeCls.');
2194 return this.removeCls.apply(this, arguments);
2198 addOverCls: function() {
2201 me.el.addCls(me.overCls);
2205 removeOverCls: function() {
2206 this.el.removeCls(this.overCls);
2209 addListener : function(element, listeners, scope, options) {
2214 if (Ext.isString(element) && (Ext.isObject(listeners) || options && options.element)) {
2215 if (options.element) {
2219 listeners[element] = fn;
2220 element = options.element;
2222 listeners.scope = scope;
2225 for (option in options) {
2226 if (options.hasOwnProperty(option)) {
2227 if (me.eventOptionsRe.test(option)) {
2228 listeners[option] = options[option];
2234 // At this point we have a variable called element,
2235 // and a listeners object that can be passed to on
2236 if (me[element] && me[element].on) {
2237 me.mon(me[element], listeners);
2239 me.afterRenderEvents = me.afterRenderEvents || {};
2240 me.afterRenderEvents[element] = listeners;
2244 return me.mixins.observable.addListener.apply(me, arguments);
2247 // @TODO: implement removelistener to support the dom event stuff
2249 <span id='Ext-AbstractComponent-method-getBubbleTarget'> /**
2250 </span> * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
2251 * @return {Ext.container.Container} the Container which owns this Component.
2253 getBubbleTarget : function() {
2254 return this.ownerCt;
2257 <span id='Ext-AbstractComponent-method-isFloating'> /**
2258 </span> * Method to determine whether this Component is floating.
2259 * @return {Boolean} the floating state of this component.
2261 isFloating : function() {
2262 return this.floating;
2265 <span id='Ext-AbstractComponent-method-isDraggable'> /**
2266 </span> * Method to determine whether this Component is draggable.
2267 * @return {Boolean} the draggable state of this component.
2269 isDraggable : function() {
2270 return !!this.draggable;
2273 <span id='Ext-AbstractComponent-method-isDroppable'> /**
2274 </span> * Method to determine whether this Component is droppable.
2275 * @return {Boolean} the droppable state of this component.
2277 isDroppable : function() {
2278 return !!this.droppable;
2281 <span id='Ext-AbstractComponent-method-onAdded'> /**
2283 * Method to manage awareness of when components are added to their
2284 * respective Container, firing an added event.
2285 * References are established at add time rather than at render time.
2286 * @param {Ext.container.Container} container Container which holds the component
2287 * @param {number} pos Position at which the component was added
2289 onAdded : function(container, pos) {
2290 this.ownerCt = container;
2291 this.fireEvent('added', this, container, pos);
2294 <span id='Ext-AbstractComponent-method-onRemoved'> /**
2296 * Method to manage awareness of when components are removed from their
2297 * respective Container, firing an removed event. References are properly
2298 * cleaned up after removing a component from its owning container.
2300 onRemoved : function() {
2303 me.fireEvent('removed', me, me.ownerCt);
2308 beforeDestroy : Ext.emptyFn,
2311 onResize : Ext.emptyFn,
2313 <span id='Ext-AbstractComponent-method-setSize'> /**
2314 </span> * Sets the width and height of this Component. This method fires the {@link #resize} event. This method can accept
2315 * either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.
2316 * @param {Mixed} width The new width to set. This may be one of:<div class="mdetail-params"><ul>
2317 * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2318 * <li>A String used to set the CSS width style.</li>
2319 * <li>A size object in the format <code>{width: widthValue, height: heightValue}</code>.</li>
2320 * <li><code>undefined</code> to leave the width unchanged.</li>
2321 * </ul></div>
2322 * @param {Mixed} height The new height to set (not required if a size object is passed as the first arg).
2323 * This may be one of:<div class="mdetail-params"><ul>
2324 * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2325 * <li>A String used to set the CSS height style. Animation may <b>not</b> be used.</li>
2326 * <li><code>undefined</code> to leave the height unchanged.</li>
2327 * </ul></div>
2328 * @return {Ext.Component} this
2330 setSize : function(width, height) {
2334 // support for standard size objects
2335 if (Ext.isObject(width)) {
2336 height = width.height;
2337 width = width.width;
2340 // Constrain within configured maxima
2341 if (Ext.isNumber(width)) {
2342 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2344 if (Ext.isNumber(height)) {
2345 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2348 if (!me.rendered || !me.isVisible()) {
2349 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2350 if (me.hiddenAncestor) {
2351 layoutCollection = me.hiddenAncestor.layoutOnShow;
2352 layoutCollection.remove(me);
2353 layoutCollection.add(me);
2361 me.width = (width !== undefined) ? width : me.width;
2362 me.height = (height !== undefined) ? height : me.height;
2366 me.doComponentLayout(width, height, true);
2371 setCalculatedSize : function(width, height, ownerCt) {
2375 // support for standard size objects
2376 if (Ext.isObject(width)) {
2377 ownerCt = width.ownerCt;
2378 height = width.height;
2379 width = width.width;
2382 // Constrain within configured maxima
2383 if (Ext.isNumber(width)) {
2384 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2386 if (Ext.isNumber(height)) {
2387 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2390 if (!me.rendered || !me.isVisible()) {
2391 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2392 if (me.hiddenAncestor) {
2393 layoutCollection = me.hiddenAncestor.layoutOnShow;
2394 layoutCollection.remove(me);
2395 layoutCollection.add(me);
2405 me.doComponentLayout(width, height, false, ownerCt);
2410 <span id='Ext-AbstractComponent-method-doComponentLayout'> /**
2411 </span> * This method needs to be called whenever you change something on this component that requires the Component's
2412 * layout to be recalculated.
2413 * @return {Ext.container.Container} this
2415 doComponentLayout : function(width, height, isSetSize, ownerCt) {
2417 componentLayout = me.getComponentLayout();
2419 // collapsed state is not relevant here, so no testing done.
2420 // Only Panels have a collapse method, and that just sets the width/height such that only
2421 // a single docked Header parallel to the collapseTo side are visible, and the Panel body is hidden.
2422 if (me.rendered && componentLayout) {
2423 width = (width !== undefined) ? width : me.width;
2424 height = (height !== undefined) ? height : me.height;
2430 componentLayout.layout(width, height, isSetSize, ownerCt);
2436 setComponentLayout : function(layout) {
2437 var currentLayout = this.componentLayout;
2438 if (currentLayout && currentLayout.isLayout && currentLayout != layout) {
2439 currentLayout.setOwner(null);
2441 this.componentLayout = layout;
2442 layout.setOwner(this);
2445 getComponentLayout : function() {
2448 if (!me.componentLayout || !me.componentLayout.isLayout) {
2449 me.setComponentLayout(Ext.layout.Layout.create(me.componentLayout, 'autocomponent'));
2451 return me.componentLayout;
2454 <span id='Ext-AbstractComponent-method-afterComponentLayout'> /**
2455 </span> * @param {Number} adjWidth The box-adjusted width that was set
2456 * @param {Number} adjHeight The box-adjusted height that was set
2457 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
2458 * @param {Ext.Component} layoutOwner Component which sent the layout. Only used when isSetSize is false.
2460 afterComponentLayout: function(width, height, isSetSize, layoutOwner) {
2461 this.fireEvent('resize', this, width, height);
2464 <span id='Ext-AbstractComponent-method-beforeComponentLayout'> /**
2465 </span> * Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout
2466 * from being executed.
2467 * @param {Number} adjWidth The box-adjusted width that was set
2468 * @param {Number} adjHeight The box-adjusted height that was set
2469 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
2470 * @param {Ext.Component} layoutOwner Component which sent the layout. Only used when isSetSize is false.
2472 beforeComponentLayout: function(width, height, isSetSize, layoutOwner) {
2476 <span id='Ext-AbstractComponent-method-setPosition'> /**
2477 </span> * Sets the left and top of the component. To set the page XY position instead, use {@link #setPagePosition}.
2478 * This method fires the {@link #move} event.
2479 * @param {Number} left The new left
2480 * @param {Number} top The new top
2481 * @return {Ext.Component} this
2483 setPosition : function(x, y) {
2486 if (Ext.isObject(x)) {
2495 if (x !== undefined || y !== undefined) {
2497 me.onPosition(x, y);
2498 me.fireEvent('move', me, x, y);
2504 * Called after the component is moved, this method is empty by default but can be implemented by any
2505 * subclass that needs to perform custom logic after a move occurs.
2506 * @param {Number} x The new x position
2507 * @param {Number} y The new y position
2509 onPosition: Ext.emptyFn,
2511 <span id='Ext-AbstractComponent-method-setWidth'> /**
2512 </span> * Sets the width of the component. This method fires the {@link #resize} event.
2513 * @param {Number} width The new width to setThis may be one of:<div class="mdetail-params"><ul>
2514 * <li>A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2515 * <li>A String used to set the CSS width style.</li>
2516 * </ul></div>
2517 * @return {Ext.Component} this
2519 setWidth : function(width) {
2520 return this.setSize(width);
2523 <span id='Ext-AbstractComponent-method-setHeight'> /**
2524 </span> * Sets the height of the component. This method fires the {@link #resize} event.
2525 * @param {Number} height The new height to set. This may be one of:<div class="mdetail-params"><ul>
2526 * <li>A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.core.Element#defaultUnit}s (by default, pixels).</li>
2527 * <li>A String used to set the CSS height style.</li>
2528 * <li><i>undefined</i> to leave the height unchanged.</li>
2529 * </ul></div>
2530 * @return {Ext.Component} this
2532 setHeight : function(height) {
2533 return this.setSize(undefined, height);
2536 <span id='Ext-AbstractComponent-method-getSize'> /**
2537 </span> * Gets the current size of the component's underlying element.
2538 * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
2540 getSize : function() {
2541 return this.el.getSize();
2544 <span id='Ext-AbstractComponent-method-getWidth'> /**
2545 </span> * Gets the current width of the component's underlying element.
2548 getWidth : function() {
2549 return this.el.getWidth();
2552 <span id='Ext-AbstractComponent-method-getHeight'> /**
2553 </span> * Gets the current height of the component's underlying element.
2556 getHeight : function() {
2557 return this.el.getHeight();
2560 <span id='Ext-AbstractComponent-method-getLoader'> /**
2561 </span> * Gets the {@link Ext.ComponentLoader} for this Component.
2562 * @return {Ext.ComponentLoader} The loader instance, null if it doesn't exist.
2564 getLoader: function(){
2566 autoLoad = me.autoLoad ? (Ext.isObject(me.autoLoad) ? me.autoLoad : {url: me.autoLoad}) : null,
2567 loader = me.loader || autoLoad;
2570 if (!loader.isLoader) {
2571 me.loader = Ext.create('Ext.ComponentLoader', Ext.apply({
2576 loader.setTarget(me);
2584 <span id='Ext-AbstractComponent-method-setLoading'> /**
2585 </span> * This method allows you to show or hide a LoadMask on top of this component.
2586 * @param {Boolean/Object/String} load True to show the default LoadMask, a config object
2587 * that will be passed to the LoadMask constructor, or a message String to show. False to
2588 * hide the current LoadMask.
2589 * @param {Boolean} targetEl True to mask the targetEl of this Component instead of the this.el.
2590 * For example, setting this to true on a Panel will cause only the body to be masked. (defaults to false)
2591 * @return {Ext.LoadMask} The LoadMask instance that has just been shown.
2593 setLoading : function(load, targetEl) {
2598 if (load !== false && !me.collapsed) {
2599 if (Ext.isObject(load)) {
2602 else if (Ext.isString(load)) {
2603 config = {msg: load};
2608 me.loadMask = me.loadMask || Ext.create('Ext.LoadMask', targetEl ? me.getTargetEl() : me.el, config);
2610 } else if (me.loadMask) {
2611 Ext.destroy(me.loadMask);
2619 <span id='Ext-AbstractComponent-method-setDocked'> /**
2620 </span> * Sets the dock position of this component in its parent panel. Note that
2621 * this only has effect if this item is part of the dockedItems collection
2622 * of a parent that has a DockLayout (note that any Panel has a DockLayout
2624 * @return {Component} this
2626 setDocked : function(dock, layoutParent) {
2630 if (layoutParent && me.ownerCt && me.rendered) {
2631 me.ownerCt.doComponentLayout();
2636 onDestroy : function() {
2639 if (me.monitorResize && Ext.EventManager.resizeEvent) {
2640 Ext.EventManager.resizeEvent.removeListener(me.setSize, me);
2642 Ext.destroy(me.componentLayout, me.loadMask);
2645 <span id='Ext-AbstractComponent-method-destroy'> /**
2646 </span> * Destroys the Component.
2648 destroy : function() {
2651 if (!me.isDestroyed) {
2652 if (me.fireEvent('beforedestroy', me) !== false) {
2653 me.destroying = true;
2657 delete me.floatParent;
2658 // A zIndexManager is stamped into a *floating* Component when it is added to a Container.
2659 // If it has no zIndexManager at render time, it is assigned to the global Ext.WindowManager instance.
2660 if (me.zIndexManager) {
2661 me.zIndexManager.unregister(me);
2663 } else if (me.ownerCt && me.ownerCt.remove) {
2664 me.ownerCt.remove(me, false);
2673 // Attempt to destroy all plugins
2674 Ext.destroy(me.plugins);
2676 Ext.ComponentManager.unregister(me);
2677 me.fireEvent('destroy', me);
2679 me.mixins.state.destroy.call(me);
2681 me.clearListeners();
2682 me.destroying = false;
2683 me.isDestroyed = true;
2688 <span id='Ext-AbstractComponent-method-getPlugin'> /**
2689 </span> * Retrieves a plugin by its pluginId which has been bound to this
2691 * @returns {Ext.AbstractPlugin} pluginInstance
2693 getPlugin: function(pluginId) {
2695 plugins = this.plugins,
2696 ln = plugins.length;
2697 for (; i < ln; i++) {
2698 if (plugins[i].pluginId === pluginId) {
2704 <span id='Ext-AbstractComponent-method-isDescendantOf'> /**
2705 </span> * Determines whether this component is the descendant of a particular container.
2706 * @param {Ext.Container} container
2707 * @returns {Boolean} isDescendant
2709 isDescendantOf: function(container) {
2710 return !!this.findParentBy(function(p){
2711 return p === container;
2717 prev: 'previousSibling',
2721 </pre></pre></body></html>