4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
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'>/**
19 </span> * An abstract base class which provides shared methods for Components across the Sencha product line.
21 * Please refer to sub class's documentation
24 Ext.define('Ext.AbstractComponent', {
26 /* Begin Definitions */
29 'Ext.ComponentManager'
33 observable: 'Ext.util.Observable',
34 animate: 'Ext.util.Animate',
35 state: 'Ext.state.Stateful'
38 // The "uses" property specifies class which are used in an instantiated AbstractComponent.
39 // They do *not* have to be loaded before this class may be defined - that is what "requires" is for.
42 'Ext.ComponentManager',
47 'Ext.ComponentLoader',
50 'Ext.layout.component.Auto',
63 getAutoId: function() {
64 return ++Ext.AbstractComponent.AUTO_ID;
68 <span id='Ext-AbstractComponent-cfg-id'> /**
69 </span> * @cfg {String} id
70 * The **unique id of this component instance.**
72 * It should not be necessary to use this configuration except for singleton objects in your application. Components
73 * created with an id may be accessed globally using {@link Ext#getCmp Ext.getCmp}.
75 * Instead of using assigned ids, use the {@link #itemId} config, and {@link Ext.ComponentQuery ComponentQuery}
76 * which provides selector-based searching for Sencha Components analogous to DOM querying. The {@link
77 * Ext.container.Container Container} class contains {@link Ext.container.Container#down shortcut methods} to query
78 * its descendant Components by selector.
80 * Note that this id will also be used as the element id for the containing HTML element that is rendered to the
81 * page for this component. This allows you to write id-based CSS rules to style the specific instance of this
82 * component uniquely, and also to select sub-elements using this component's id as the parent.
84 * **Note**: to avoid complications imposed by a unique id also see `{@link #itemId}`.
86 * **Note**: to access the container of a Component see `{@link #ownerCt}`.
88 * Defaults to an {@link #getId auto-assigned id}.
91 <span id='Ext-AbstractComponent-cfg-itemId'> /**
92 </span> * @cfg {String} itemId
93 * An itemId can be used as an alternative way to get a reference to a component when no object reference is
94 * available. Instead of using an `{@link #id}` with {@link Ext}.{@link Ext#getCmp getCmp}, use `itemId` with
95 * {@link Ext.container.Container}.{@link Ext.container.Container#getComponent getComponent} which will retrieve
96 * `itemId`'s or {@link #id}'s. Since `itemId`'s are an index to the container's internal MixedCollection, the
97 * `itemId` is scoped locally to the container -- avoiding potential conflicts with {@link Ext.ComponentManager}
98 * which requires a **unique** `{@link #id}`.
100 * var c = new Ext.panel.Panel({ //
101 * {@link Ext.Component#height height}: 300,
102 * {@link #renderTo}: document.body,
103 * {@link Ext.container.Container#layout layout}: 'auto',
104 * {@link Ext.container.Container#items items}: [
107 * {@link Ext.panel.Panel#title title}: 'Panel 1',
108 * {@link Ext.Component#height height}: 150
112 * {@link Ext.panel.Panel#title title}: 'Panel 2',
113 * {@link Ext.Component#height height}: 150
117 * p1 = c.{@link Ext.container.Container#getComponent getComponent}('p1'); // not the same as {@link Ext#getCmp Ext.getCmp()}
118 * p2 = p1.{@link #ownerCt}.{@link Ext.container.Container#getComponent getComponent}('p2'); // reference via a sibling
120 * Also see {@link #id}, `{@link Ext.container.Container#query}`, `{@link Ext.container.Container#down}` and
121 * `{@link Ext.container.Container#child}`.
123 * **Note**: to access the container of an item see {@link #ownerCt}.
126 <span id='Ext-AbstractComponent-property-ownerCt'> /**
127 </span> * @property {Ext.Container} ownerCt
128 * This Component's owner {@link Ext.container.Container Container} (is set automatically
129 * when this Component is added to a Container). Read-only.
131 * **Note**: to access items within the Container see {@link #itemId}.
134 <span id='Ext-AbstractComponent-property-layoutManagedWidth'> /**
135 </span> * @property {Boolean} layoutManagedWidth
137 * Flag set by the container layout to which this Component is added.
138 * If the layout manages this Component's width, it sets the value to 1.
139 * If it does NOT manage the width, it sets it to 2.
140 * If the layout MAY affect the width, but only if the owning Container has a fixed width, this is set to 0.
143 <span id='Ext-AbstractComponent-property-layoutManagedHeight'> /**
144 </span> * @property {Boolean} layoutManagedHeight
146 * Flag set by the container layout to which this Component is added.
147 * If the layout manages this Component's height, it sets the value to 1.
148 * If it does NOT manage the height, it sets it to 2.
149 * If the layout MAY affect the height, but only if the owning Container has a fixed height, this is set to 0.
152 <span id='Ext-AbstractComponent-cfg-autoEl'> /**
153 </span> * @cfg {String/Object} autoEl
154 * A tag name or {@link Ext.DomHelper DomHelper} spec used to create the {@link #getEl Element} which will
155 * encapsulate this Component.
157 * You do not normally need to specify this. For the base classes {@link Ext.Component} and
158 * {@link Ext.container.Container}, this defaults to **'div'**. The more complex Sencha classes use a more
159 * complex DOM structure specified by their own {@link #renderTpl}s.
161 * This is intended to allow the developer to create application-specific utility Components encapsulated by
162 * different DOM elements. Example usage:
165 * xtype: 'component',
168 * src: 'http://www.example.com/example.jpg'
171 * xtype: 'component',
174 * html: 'autoEl is cool!'
177 * xtype: 'container',
179 * cls: 'ux-unordered-list',
181 * xtype: 'component',
183 * html: 'First list item'
188 <span id='Ext-AbstractComponent-cfg-renderTpl'> /**
189 </span> * @cfg {Ext.XTemplate/String/String[]} renderTpl
190 * An {@link Ext.XTemplate XTemplate} used to create the internal structure inside this Component's encapsulating
191 * {@link #getEl Element}.
193 * You do not normally need to specify this. For the base classes {@link Ext.Component} and
194 * {@link Ext.container.Container}, this defaults to **`null`** which means that they will be initially rendered
195 * with no internal structure; they render their {@link #getEl Element} empty. The more specialized ExtJS and Touch
196 * classes which use a more complex DOM structure, provide their own template definitions.
198 * This is intended to allow the developer to create application-specific utility Components with customized
199 * internal structure.
201 * Upon rendering, any created child elements may be automatically imported into object properties using the
202 * {@link #renderSelectors} and {@link #childEls} options.
206 <span id='Ext-AbstractComponent-cfg-renderData'> /**
207 </span> * @cfg {Object} renderData
209 * The data used by {@link #renderTpl} in addition to the following property values of the component:
218 * See {@link #renderSelectors} and {@link #childEls} for usage examples.
221 <span id='Ext-AbstractComponent-cfg-renderSelectors'> /**
222 </span> * @cfg {Object} renderSelectors
223 * An object containing properties specifying {@link Ext.DomQuery DomQuery} selectors which identify child elements
224 * created by the render process.
226 * After the Component's internal structure is rendered according to the {@link #renderTpl}, this object is iterated through,
227 * and the found Elements are added as properties to the Component using the `renderSelector` property name.
229 * For example, a Component which renderes a title and description into its element:
231 * Ext.create('Ext.Component', {
232 * renderTo: Ext.getBody(),
234 * '<h1 class="title">{title}</h1>',
235 * '<p>{desc}</p>'
238 * title: "Error",
239 * desc: "Something went wrong"
242 * titleEl: 'h1.title',
246 * afterrender: function(cmp){
247 * // After rendering the component will have a titleEl and descEl properties
248 * cmp.titleEl.setStyle({color: "red"});
253 * For a faster, but less flexible, alternative that achieves the same end result (properties for child elements on the
254 * Component after render), see {@link #childEls} and {@link #addChildEls}.
257 <span id='Ext-AbstractComponent-cfg-childEls'> /**
258 </span> * @cfg {Object[]} childEls
259 * An array describing the child elements of the Component. Each member of the array
260 * is an object with these properties:
262 * - `name` - The property name on the Component for the child element.
263 * - `itemId` - The id to combine with the Component's id that is the id of the child element.
264 * - `id` - The id of the child element.
266 * If the array member is a string, it is equivalent to `{ name: m, itemId: m }`.
268 * For example, a Component which renders a title and body text:
270 * Ext.create('Ext.Component', {
271 * renderTo: Ext.getBody(),
273 * '<h1 id="{id}-title">{title}</h1>',
274 * '<p>{msg}</p>',
277 * title: "Error",
278 * msg: "Something went wrong"
280 * childEls: ["title"],
282 * afterrender: function(cmp){
283 * // After rendering the component will have a title property
284 * cmp.title.setStyle({color: "red"});
289 * A more flexible, but somewhat slower, approach is {@link #renderSelectors}.
292 <span id='Ext-AbstractComponent-cfg-renderTo'> /**
293 </span> * @cfg {String/HTMLElement/Ext.Element} renderTo
294 * Specify the id of the element, a DOM element or an existing Element that this component will be rendered into.
298 * Do *not* use this option if the Component is to be a child item of a {@link Ext.container.Container Container}.
299 * It is the responsibility of the {@link Ext.container.Container Container}'s
300 * {@link Ext.container.Container#layout layout manager} to render and manage its child items.
302 * When using this config, a call to render() is not required.
304 * See `{@link #render}` also.
307 <span id='Ext-AbstractComponent-cfg-frame'> /**
308 </span> * @cfg {Boolean} frame
309 * Specify as `true` to have the Component inject framing elements within the Component at render time to provide a
310 * graphical rounded frame around the Component content.
312 * This is only necessary when running on outdated, or non standard-compliant browsers such as Microsoft's Internet
313 * Explorer prior to version 9 which do not support rounded corners natively.
315 * The extra space taken up by this framing is available from the read only property {@link #frameSize}.
318 <span id='Ext-AbstractComponent-property-frameSize'> /**
319 </span> * @property {Object} frameSize
320 * Read-only property indicating the width of any framing elements which were added within the encapsulating element
321 * to provide graphical, rounded borders. See the {@link #frame} config.
323 * This is an object containing the frame width in pixels for all four sides of the Component containing the
324 * following properties:
326 * @property {Number} frameSize.top The width of the top framing element in pixels.
327 * @property {Number} frameSize.right The width of the right framing element in pixels.
328 * @property {Number} frameSize.bottom The width of the bottom framing element in pixels.
329 * @property {Number} frameSize.left The width of the left framing element in pixels.
332 <span id='Ext-AbstractComponent-cfg-componentLayout'> /**
333 </span> * @cfg {String/Object} componentLayout
334 * The sizing and positioning of a Component's internal Elements is the responsibility of the Component's layout
335 * manager which sizes a Component's internal structure in response to the Component being sized.
337 * Generally, developers will not use this configuration as all provided Components which need their internal
338 * elements sizing (Such as {@link Ext.form.field.Base input fields}) come with their own componentLayout managers.
340 * The {@link Ext.layout.container.Auto default layout manager} will be used on instances of the base Ext.Component
341 * class which simply sizes the Component's encapsulating element to the height and width specified in the
342 * {@link #setSize} method.
345 <span id='Ext-AbstractComponent-cfg-tpl'> /**
346 </span> * @cfg {Ext.XTemplate/Ext.Template/String/String[]} tpl
347 * An {@link Ext.Template}, {@link Ext.XTemplate} or an array of strings to form an Ext.XTemplate. Used in
348 * conjunction with the `{@link #data}` and `{@link #tplWriteMode}` configurations.
351 <span id='Ext-AbstractComponent-cfg-data'> /**
352 </span> * @cfg {Object} data
353 * The initial set of data to apply to the `{@link #tpl}` to update the content area of the Component.
356 <span id='Ext-AbstractComponent-cfg-xtype'> /**
357 </span> * @cfg {String} xtype
358 * The `xtype` configuration option can be used to optimize Component creation and rendering. It serves as a
359 * shortcut to the full componet name. For example, the component `Ext.button.Button` has an xtype of `button`.
361 * You can define your own xtype on a custom {@link Ext.Component component} by specifying the
362 * {@link Ext.Class#alias alias} config option with a prefix of `widget`. For example:
364 * Ext.define('PressMeButton', {
365 * extend: 'Ext.button.Button',
366 * alias: 'widget.pressmebutton',
370 * Any Component can be created implicitly as an object config with an xtype specified, allowing it to be
371 * declared and passed into the rendering pipeline without actually being instantiated as an object. Not only is
372 * rendering deferred, but the actual creation of the object itself is also deferred, saving memory and resources
373 * until they are actually needed. In complex, nested layouts containing many Components, this can make a
374 * noticeable improvement in performance.
376 * // Explicit creation of contained Components:
377 * var panel = new Ext.Panel({
380 * Ext.create('Ext.button.Button', {
386 * // Implicit creation using xtype:
387 * var panel = new Ext.Panel({
395 * In the first example, the button will always be created immediately during the panel's initialization. With
396 * many added Components, this approach could potentially slow the rendering of the page. In the second example,
397 * the button will not be created or rendered until the panel is actually displayed in the browser. If the panel
398 * is never displayed (for example, if it is a tab that remains hidden) then the button will never be created and
399 * will never consume any resources whatsoever.
402 <span id='Ext-AbstractComponent-cfg-tplWriteMode'> /**
403 </span> * @cfg {String} tplWriteMode
404 * The Ext.(X)Template method to use when updating the content area of the Component.
405 * See `{@link Ext.XTemplate#overwrite}` for information on default mode.
407 tplWriteMode: 'overwrite',
409 <span id='Ext-AbstractComponent-cfg-baseCls'> /**
410 </span> * @cfg {String} [baseCls='x-component']
411 * The base CSS class to apply to this components's element. This will also be prepended to elements within this
412 * component like Panel's body will get a class x-panel-body. This means that if you create a subclass of Panel, and
413 * you want it to get all the Panels styling for the element and the body, you leave the baseCls x-panel and use
414 * componentCls to add specific styling for this component.
416 baseCls: Ext.baseCSSPrefix + 'component',
418 <span id='Ext-AbstractComponent-cfg-componentCls'> /**
419 </span> * @cfg {String} componentCls
420 * CSS Class to be added to a components root level element to give distinction to it via styling.
423 <span id='Ext-AbstractComponent-cfg-cls'> /**
424 </span> * @cfg {String} [cls='']
425 * An optional extra CSS class that will be added to this component's Element. This can be useful
426 * for adding customized styles to the component or any of its children using standard CSS rules.
429 <span id='Ext-AbstractComponent-cfg-overCls'> /**
430 </span> * @cfg {String} [overCls='']
431 * An optional extra CSS class that will be added to this component's Element when the mouse moves over the Element,
432 * and removed when the mouse moves out. This can be useful for adding customized 'active' or 'hover' styles to the
433 * component or any of its children using standard CSS rules.
436 <span id='Ext-AbstractComponent-cfg-disabledCls'> /**
437 </span> * @cfg {String} [disabledCls='x-item-disabled']
438 * CSS class to add when the Component is disabled. Defaults to 'x-item-disabled'.
440 disabledCls: Ext.baseCSSPrefix + 'item-disabled',
442 <span id='Ext-AbstractComponent-cfg-ui'> /**
443 </span> * @cfg {String/String[]} ui
444 * A set style for a component. Can be a string or an Array of multiple strings (UIs)
448 <span id='Ext-AbstractComponent-cfg-uiCls'> /**
449 </span> * @cfg {String[]} uiCls
450 * An array of of classNames which are currently applied to this component
455 <span id='Ext-AbstractComponent-cfg-style'> /**
456 </span> * @cfg {String} style
457 * A custom style specification to be applied to this component's Element. Should be a valid argument to
458 * {@link Ext.Element#applyStyles}.
460 * new Ext.panel.Panel({
461 * title: 'Some Title',
462 * renderTo: Ext.getBody(),
463 * width: 400, height: 300,
469 * marginBottom: '10px'
472 * new Ext.button.Button({
476 * marginBottom: '10px'
483 <span id='Ext-AbstractComponent-cfg-width'> /**
484 </span> * @cfg {Number} width
485 * The width of this component in pixels.
488 <span id='Ext-AbstractComponent-cfg-height'> /**
489 </span> * @cfg {Number} height
490 * The height of this component in pixels.
493 <span id='Ext-AbstractComponent-cfg-border'> /**
494 </span> * @cfg {Number/String} border
495 * Specifies the border for this component. The border can be a single numeric value to apply to all sides or it can
496 * be a CSS style specification for each style, for example: '10 5 3 10'.
499 <span id='Ext-AbstractComponent-cfg-padding'> /**
500 </span> * @cfg {Number/String} padding
501 * Specifies the padding for this component. The padding can be a single numeric value to apply to all sides or it
502 * can be a CSS style specification for each style, for example: '10 5 3 10'.
505 <span id='Ext-AbstractComponent-cfg-margin'> /**
506 </span> * @cfg {Number/String} margin
507 * Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can
508 * be a CSS style specification for each style, for example: '10 5 3 10'.
511 <span id='Ext-AbstractComponent-cfg-hidden'> /**
512 </span> * @cfg {Boolean} hidden
513 * True to hide the component.
517 <span id='Ext-AbstractComponent-cfg-disabled'> /**
518 </span> * @cfg {Boolean} disabled
519 * True to disable the component.
523 <span id='Ext-AbstractComponent-cfg-draggable'> /**
524 </span> * @cfg {Boolean} [draggable=false]
525 * Allows the component to be dragged.
528 <span id='Ext-AbstractComponent-property-draggable'> /**
529 </span> * @property {Boolean} draggable
530 * Read-only property indicating whether or not the component can be dragged
534 <span id='Ext-AbstractComponent-cfg-floating'> /**
535 </span> * @cfg {Boolean} floating
536 * Create the Component as a floating and use absolute positioning.
538 * The z-index of floating Components is handled by a ZIndexManager. If you simply render a floating Component into the DOM, it will be managed
539 * by the global {@link Ext.WindowManager WindowManager}.
541 * If you include a floating Component as a child item of a Container, then upon render, ExtJS will seek an ancestor floating Component to house a new
542 * ZIndexManager instance to manage its descendant floaters. If no floating ancestor can be found, the global WindowManager will be used.
544 * When a floating Component which has a ZindexManager managing descendant floaters is destroyed, those descendant floaters will also be destroyed.
548 <span id='Ext-AbstractComponent-cfg-hideMode'> /**
549 </span> * @cfg {String} hideMode
550 * A String which specifies how this Component's encapsulating DOM element will be hidden. Values may be:
552 * - `'display'` : The Component will be hidden using the `display: none` style.
553 * - `'visibility'` : The Component will be hidden using the `visibility: hidden` style.
554 * - `'offsets'` : The Component will be hidden by absolutely positioning it out of the visible area of the document.
555 * This is useful when a hidden Component must maintain measurable dimensions. Hiding using `display` results in a
556 * Component having zero dimensions.
560 <span id='Ext-AbstractComponent-cfg-contentEl'> /**
561 </span> * @cfg {String} contentEl
562 * Specify an existing HTML element, or the `id` of an existing HTML element to use as the content for this component.
564 * This config option is used to take an existing HTML element and place it in the layout element of a new component
565 * (it simply moves the specified DOM element _after the Component is rendered_ to use as the content.
569 * The specified HTML element is appended to the layout element of the component _after any configured
570 * {@link #html HTML} has been inserted_, and so the document will not contain this element at the time
571 * the {@link #render} event is fired.
573 * The specified HTML element used will not participate in any **`{@link Ext.container.Container#layout layout}`**
574 * scheme that the Component may use. It is just HTML. Layouts operate on child
575 * **`{@link Ext.container.Container#items items}`**.
577 * Add either the `x-hidden` or the `x-hide-display` CSS class to prevent a brief flicker of the content before it
578 * is rendered to the panel.
581 <span id='Ext-AbstractComponent-cfg-html'> /**
582 </span> * @cfg {String/Object} [html='']
583 * An HTML fragment, or a {@link Ext.DomHelper DomHelper} specification to use as the layout element content.
584 * The HTML content is added after the component is rendered, so the document will not contain this HTML at the time
585 * the {@link #render} event is fired. This content is inserted into the body _before_ any configured {@link #contentEl}
589 <span id='Ext-AbstractComponent-cfg-styleHtmlContent'> /**
590 </span> * @cfg {Boolean} styleHtmlContent
591 * True to automatically style the html inside the content target of this component (body for panels).
593 styleHtmlContent: false,
595 <span id='Ext-AbstractComponent-cfg-styleHtmlCls'> /**
596 </span> * @cfg {String} [styleHtmlCls='x-html']
597 * The class that is added to the content target when you set styleHtmlContent to true.
599 styleHtmlCls: Ext.baseCSSPrefix + 'html',
601 <span id='Ext-AbstractComponent-cfg-minHeight'> /**
602 </span> * @cfg {Number} minHeight
603 * The minimum value in pixels which this Component will set its height to.
605 * **Warning:** This will override any size management applied by layout managers.
607 <span id='Ext-AbstractComponent-cfg-minWidth'> /**
608 </span> * @cfg {Number} minWidth
609 * The minimum value in pixels which this Component will set its width to.
611 * **Warning:** This will override any size management applied by layout managers.
613 <span id='Ext-AbstractComponent-cfg-maxHeight'> /**
614 </span> * @cfg {Number} maxHeight
615 * The maximum value in pixels which this Component will set its height to.
617 * **Warning:** This will override any size management applied by layout managers.
619 <span id='Ext-AbstractComponent-cfg-maxWidth'> /**
620 </span> * @cfg {Number} maxWidth
621 * The maximum value in pixels which this Component will set its width to.
623 * **Warning:** This will override any size management applied by layout managers.
626 <span id='Ext-AbstractComponent-cfg-loader'> /**
627 </span> * @cfg {Ext.ComponentLoader/Object} loader
628 * A configuration object or an instance of a {@link Ext.ComponentLoader} to load remote content for this Component.
631 <span id='Ext-AbstractComponent-cfg-autoShow'> /**
632 </span> * @cfg {Boolean} autoShow
633 * True to automatically show the component upon creation. This config option may only be used for
634 * {@link #floating} components or components that use {@link #autoRender}. Defaults to false.
638 <span id='Ext-AbstractComponent-cfg-autoRender'> /**
639 </span> * @cfg {Boolean/String/HTMLElement/Ext.Element} autoRender
640 * This config is intended mainly for non-{@link #floating} Components which may or may not be shown. Instead of using
641 * {@link #renderTo} in the configuration, and rendering upon construction, this allows a Component to render itself
642 * upon first _{@link #show}_. If {@link #floating} is true, the value of this config is omited as if it is `true`.
644 * Specify as `true` to have this Component render to the document body upon first show.
646 * Specify as an element, or the ID of an element to have this Component render to a specific element upon first
649 * **This defaults to `true` for the {@link Ext.window.Window Window} class.**
658 <span id='Ext-AbstractComponent-cfg-plugins'> /**
659 </span> * @cfg {Object/Object[]} plugins
660 * An object or array of objects that will provide custom functionality for this component. The only requirement for
661 * a valid plugin is that it contain an init method that accepts a reference of type Ext.Component. When a component
662 * is created, if any plugins are available, the component will call the init method on each plugin, passing a
663 * reference to itself. Each plugin can then call methods or respond to events on the component as needed to provide
667 <span id='Ext-AbstractComponent-property-rendered'> /**
668 </span> * @property {Boolean} rendered
669 * Read-only property indicating whether or not the component has been rendered.
673 <span id='Ext-AbstractComponent-property-componentLayoutCounter'> /**
674 </span> * @property {Number} componentLayoutCounter
676 * The number of component layout calls made on this object.
678 componentLayoutCounter: 0,
682 trimRe: /^\s+|\s+$/g,
686 <span id='Ext-AbstractComponent-property-maskOnDisable'> /**
687 </span> * @property {Boolean} maskOnDisable
688 * This is an internal flag that you use when creating custom components. By default this is set to true which means
689 * that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab
690 * override this property to false since they want to implement custom disable logic.
694 <span id='Ext-AbstractComponent-method-constructor'> /**
695 </span> * Creates new Component.
696 * @param {Object} config (optional) Config object.
698 constructor : function(config) {
702 config = config || {};
703 me.initialConfig = config;
704 Ext.apply(me, config);
707 <span id='Ext-AbstractComponent-event-beforeactivate'> /**
708 </span> * @event beforeactivate
709 * Fires before a Component has been visually activated. Returning false from an event listener can prevent
710 * the activate from occurring.
711 * @param {Ext.Component} this
714 <span id='Ext-AbstractComponent-event-activate'> /**
715 </span> * @event activate
716 * Fires after a Component has been visually activated.
717 * @param {Ext.Component} this
720 <span id='Ext-AbstractComponent-event-beforedeactivate'> /**
721 </span> * @event beforedeactivate
722 * Fires before a Component has been visually deactivated. Returning false from an event listener can
723 * prevent the deactivate from occurring.
724 * @param {Ext.Component} this
727 <span id='Ext-AbstractComponent-event-deactivate'> /**
728 </span> * @event deactivate
729 * Fires after a Component has been visually deactivated.
730 * @param {Ext.Component} this
733 <span id='Ext-AbstractComponent-event-added'> /**
734 </span> * @event added
735 * Fires after a Component had been added to a Container.
736 * @param {Ext.Component} this
737 * @param {Ext.container.Container} container Parent Container
738 * @param {Number} pos position of Component
741 <span id='Ext-AbstractComponent-event-disable'> /**
742 </span> * @event disable
743 * Fires after the component is disabled.
744 * @param {Ext.Component} this
747 <span id='Ext-AbstractComponent-event-enable'> /**
748 </span> * @event enable
749 * Fires after the component is enabled.
750 * @param {Ext.Component} this
753 <span id='Ext-AbstractComponent-event-beforeshow'> /**
754 </span> * @event beforeshow
755 * Fires before the component is shown when calling the {@link #show} method. Return false from an event
756 * handler to stop the show.
757 * @param {Ext.Component} this
760 <span id='Ext-AbstractComponent-event-show'> /**
761 </span> * @event show
762 * Fires after the component is shown when calling the {@link #show} method.
763 * @param {Ext.Component} this
766 <span id='Ext-AbstractComponent-event-beforehide'> /**
767 </span> * @event beforehide
768 * Fires before the component is hidden when calling the {@link #hide} method. Return false from an event
769 * handler to stop the hide.
770 * @param {Ext.Component} this
773 <span id='Ext-AbstractComponent-event-hide'> /**
774 </span> * @event hide
775 * Fires after the component is hidden. Fires after the component is hidden when calling the {@link #hide}
777 * @param {Ext.Component} this
780 <span id='Ext-AbstractComponent-event-removed'> /**
781 </span> * @event removed
782 * Fires when a component is removed from an Ext.container.Container
783 * @param {Ext.Component} this
784 * @param {Ext.container.Container} ownerCt Container which holds the component
787 <span id='Ext-AbstractComponent-event-beforerender'> /**
788 </span> * @event beforerender
789 * Fires before the component is {@link #rendered}. Return false from an event handler to stop the
791 * @param {Ext.Component} this
794 <span id='Ext-AbstractComponent-event-render'> /**
795 </span> * @event render
796 * Fires after the component markup is {@link #rendered}.
797 * @param {Ext.Component} this
800 <span id='Ext-AbstractComponent-event-afterrender'> /**
801 </span> * @event afterrender
802 * Fires after the component rendering is finished.
804 * The afterrender event is fired after this Component has been {@link #rendered}, been postprocesed by any
805 * afterRender method defined for the Component.
806 * @param {Ext.Component} this
809 <span id='Ext-AbstractComponent-event-beforedestroy'> /**
810 </span> * @event beforedestroy
811 * Fires before the component is {@link #destroy}ed. Return false from an event handler to stop the
813 * @param {Ext.Component} this
816 <span id='Ext-AbstractComponent-event-destroy'> /**
817 </span> * @event destroy
818 * Fires after the component is {@link #destroy}ed.
819 * @param {Ext.Component} this
822 <span id='Ext-AbstractComponent-event-resize'> /**
823 </span> * @event resize
824 * Fires after the component is resized.
825 * @param {Ext.Component} this
826 * @param {Number} adjWidth The box-adjusted width that was set
827 * @param {Number} adjHeight The box-adjusted height that was set
830 <span id='Ext-AbstractComponent-event-move'> /**
831 </span> * @event move
832 * Fires after the component is moved.
833 * @param {Ext.Component} this
834 * @param {Number} x The new x position
835 * @param {Number} y The new y position
843 me.additionalCls = [];
844 me.renderData = me.renderData || {};
845 me.renderSelectors = me.renderSelectors || {};
848 me.plugins = [].concat(me.plugins);
849 me.constructPlugins();
854 // ititComponent gets a chance to change the id property before registering
855 Ext.ComponentManager.register(me);
857 // Dont pass the config so that it is not applied to 'this' again
858 me.mixins.observable.constructor.call(me);
859 me.mixins.state.constructor.call(me, config);
861 // Save state on resize.
862 this.addStateEvents('resize');
864 // Move this into Observable?
866 me.plugins = [].concat(me.plugins);
867 for (i = 0, len = me.plugins.length; i < len; i++) {
868 me.plugins[i] = me.initPlugin(me.plugins[i]);
872 me.loader = me.getLoader();
875 me.render(me.renderTo);
876 // EXTJSIV-1935 - should be a way to do afterShow or something, but that
877 // won't work. Likewise, rendering hidden and then showing (w/autoShow) has
878 // implications to afterRender so we cannot do that.
886 if (Ext.isDefined(me.disabledClass)) {
887 if (Ext.isDefined(Ext.global.console)) {
888 Ext.global.console.warn('Ext.Component: disabledClass has been deprecated. Please use disabledCls.');
890 me.disabledCls = me.disabledClass;
891 delete me.disabledClass;
896 initComponent: function () {
897 // This is called again here to allow derived classes to add plugin configs to the
898 // plugins array before calling down to this, the base initComponent.
899 this.constructPlugins();
902 <span id='Ext-AbstractComponent-method-getState'> /**
903 </span> * The supplied default state gathering method for the AbstractComponent class.
905 * This method returns dimension settings such as `flex`, `anchor`, `width` and `height` along with `collapsed`
908 * Subclasses which implement more complex state should call the superclass's implementation, and apply their state
909 * to the result if this basic state is to be saved.
911 * Note that Component state will only be saved if the Component has a {@link #stateId} and there as a StateProvider
912 * configured for the document.
916 getState: function() {
918 layout = me.ownerCt ? (me.shadowOwnerCt || me.ownerCt).getLayout() : null,
920 collapsed: me.collapsed
924 cm = me.collapseMemento,
927 // If a Panel-local collapse has taken place, use remembered values as the dimensions.
928 // TODO: remove this coupling with Panel's privates! All collapse/expand logic should be refactored into one place.
929 if (me.collapsed && cm) {
930 if (Ext.isDefined(cm.data.width)) {
933 if (Ext.isDefined(cm.data.height)) {
938 // If we have flex, only store the perpendicular dimension.
939 if (layout && me.flex) {
940 state.flex = me.flex;
941 if (layout.perpendicularPrefix) {
942 state[layout.perpendicularPrefix] = me['get' + layout.perpendicularPrefixCap]();
945 if (Ext.isDefined(Ext.global.console)) {
946 Ext.global.console.warn('Ext.Component: Specified a flex value on a component not inside a Box layout');
951 // If we have anchor, only store dimensions which are *not* being anchored
952 else if (layout && me.anchor) {
953 state.anchor = me.anchor;
954 anchors = me.anchor.split(' ').concat(null);
962 state.height = height;
972 state.height = height;
976 // Don't save dimensions if they are unchanged from the original configuration.
977 if (state.width == me.initialConfig.width) {
980 if (state.height == me.initialConfig.height) {
984 // If a Box layout was managing the perpendicular dimension, don't save that dimension
985 if (layout && layout.align && (layout.align.indexOf('stretch') !== -1)) {
986 delete state[layout.perpendicularPrefix];
993 animate: function(animObj) {
997 animObj = animObj || {};
998 to = animObj.to || {};
1000 if (Ext.fx.Manager.hasFxBlock(me.id)) {
1003 // Special processing for animating Component dimensions.
1004 if (!animObj.dynamic && (to.height || to.width)) {
1005 var curWidth = me.getWidth(),
1007 curHeight = me.getHeight(),
1009 needsResize = false;
1011 if (to.height && to.height > curHeight) {
1015 if (to.width && to.width > curWidth) {
1020 // If any dimensions are being increased, we must resize the internal structure
1021 // of the Component, but then clip it by sizing its encapsulating element back to original dimensions.
1022 // The animation will then progressively reveal the larger content.
1024 var clearWidth = !Ext.isNumber(me.width),
1025 clearHeight = !Ext.isNumber(me.height);
1027 me.componentLayout.childrenChanged = true;
1028 me.setSize(w, h, me.ownerCt);
1029 me.el.setSize(curWidth, curHeight);
1038 return me.mixins.animate.animate.apply(me, arguments);
1041 <span id='Ext-AbstractComponent-method-findLayoutController'> /**
1042 </span> * This method finds the topmost active layout who's processing will eventually determine the size and position of
1045 * This method is useful when dynamically adding Components into Containers, and some processing must take place
1046 * after the final sizing and positioning of the Component has been performed.
1048 * @return {Ext.Component}
1050 findLayoutController: function() {
1051 return this.findParentBy(function(c) {
1052 // Return true if we are at the root of the Container tree
1053 // or this Container's layout is busy but the next one up is not.
1054 return !c.ownerCt || (c.layout.layoutBusy && !c.ownerCt.layout.layoutBusy);
1058 onShow : function() {
1060 var needsLayout = this.needsLayout;
1061 if (Ext.isObject(needsLayout)) {
1062 this.doComponentLayout(needsLayout.width, needsLayout.height, needsLayout.isSetSize, needsLayout.ownerCt);
1066 constructPlugin: function(plugin) {
1067 if (plugin.ptype && typeof plugin.init != 'function') {
1069 plugin = Ext.PluginManager.create(plugin);
1071 else if (typeof plugin == 'string') {
1072 plugin = Ext.PluginManager.create({
1080 <span id='Ext-AbstractComponent-method-constructPlugins'> /**
1081 </span> * Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their
1082 * appropriate instances.
1084 constructPlugins: function() {
1086 plugins = me.plugins,
1090 for (i = 0, len = plugins.length; i < len; i++) {
1091 // this just returns already-constructed plugin instances...
1092 plugins[i] = me.constructPlugin(plugins[i]);
1098 initPlugin : function(plugin) {
1104 <span id='Ext-AbstractComponent-method-doAutoRender'> /**
1105 </span> * Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them
1106 * within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to
1109 doAutoRender: function() {
1112 me.render(document.body);
1114 me.render(Ext.isBoolean(me.autoRender) ? Ext.getBody() : me.autoRender);
1119 render : function(container, position) {
1122 if (!me.rendered && me.fireEvent('beforerender', me) !== false) {
1124 // Flag set during the render process.
1125 // It can be used to inhibit event-driven layout calls during the render phase
1126 me.rendering = true;
1128 // If this.el is defined, we want to make sure we are dealing with
1131 me.el = Ext.get(me.el);
1134 // Perform render-time processing for floating Components
1139 container = me.initContainer(container);
1141 me.onRender(container, position);
1143 // Tell the encapsulating element to hide itself in the way the Component is configured to hide
1144 // This means DISPLAY, VISIBILITY or OFFSETS.
1145 me.el.setVisibilityMode(Ext.Element[me.hideMode.toUpperCase()]);
1148 me.el.hover(me.addOverCls, me.removeOverCls, me);
1151 me.fireEvent('render', me);
1155 me.afterRender(container);
1156 me.fireEvent('afterrender', me);
1161 // Hiding during the render process should not perform any ancillary
1162 // actions that the full hide process does; It is not hiding, it begins in a hidden state.'
1163 // So just make the element hidden according to the configured hideMode
1168 // pass silent so the event doesn't fire the first time.
1172 // Delete the flag once the rendering is done.
1173 delete me.rendering;
1179 onRender : function(container, position) {
1182 styles = me.initStyles(),
1183 renderTpl, renderData, i;
1185 position = me.getInsertPosition(position);
1189 el = Ext.DomHelper.insertBefore(position, me.getElConfig(), true);
1192 el = Ext.DomHelper.append(container, me.getElConfig(), true);
1195 else if (me.allowDomMove !== false) {
1197 container.dom.insertBefore(el.dom, position);
1199 container.dom.appendChild(el.dom);
1203 if (Ext.scopeResetCSS && !me.ownerCt) {
1204 // If this component's el is the body element, we add the reset class to the html tag
1205 if (el.dom == Ext.getBody().dom) {
1206 el.parent().addCls(Ext.baseCSSPrefix + 'reset');
1209 // Else we wrap this element in an element that adds the reset class.
1210 me.resetEl = el.wrap({
1211 cls: Ext.baseCSSPrefix + 'reset'
1218 el.addCls(me.initCls());
1219 el.setStyle(styles);
1221 // Here we check if the component has a height set through style or css.
1222 // If it does then we set the this.height to that value and it won't be
1223 // considered an auto height component
1224 // if (this.height === undefined) {
1225 // var height = el.getHeight();
1226 // // This hopefully means that the panel has an explicit height set in style or css
1227 // if (height - el.getPadding('tb') - el.getBorderWidth('tb') > 0) {
1228 // this.height = height;
1236 renderTpl = me.initRenderTpl();
1238 renderData = me.initRenderData();
1239 renderTpl.append(me.getTargetEl(), renderData);
1242 me.applyRenderSelectors();
1248 afterRender : function() {
1253 me.getComponentLayout();
1255 // Set the size if a size is configured, or if this is the outermost Container.
1256 // Also, if this is a collapsed Panel, it needs an initial component layout
1257 // to lay out its header so that it can have a height determined.
1258 if (me.collapsed || (!me.ownerCt || (me.height || me.width))) {
1259 me.setSize(me.width, me.height);
1261 // It is expected that child items be rendered before this method returns and
1262 // the afterrender event fires. Since we aren't going to do the layout now, we
1263 // must render the child items. This is handled implicitly above in the layout
1264 // caused by setSize.
1265 me.renderChildren();
1268 // For floaters, calculate x and y if they aren't defined by aligning
1269 // the sized element to the center of either the container or the ownerCt
1270 if (me.floating && (me.x === undefined || me.y === undefined)) {
1271 if (me.floatParent) {
1272 xy = me.el.getAlignToXY(me.floatParent.getTargetEl(), 'c-c');
1273 pos = me.floatParent.getTargetEl().translatePoints(xy[0], xy[1]);
1275 xy = me.el.getAlignToXY(me.container, 'c-c');
1276 pos = me.container.translatePoints(xy[0], xy[1]);
1278 me.x = me.x === undefined ? pos.left: me.x;
1279 me.y = me.y === undefined ? pos.top: me.y;
1282 if (Ext.isDefined(me.x) || Ext.isDefined(me.y)) {
1283 me.setPosition(me.x, me.y);
1286 if (me.styleHtmlContent) {
1287 me.getTargetEl().addCls(me.styleHtmlCls);
1291 <span id='Ext-AbstractComponent-method-registerFloatingItem'> /**
1293 * Called by Component#doAutoRender
1295 * Register a Container configured `floating: true` with this Component's {@link Ext.ZIndexManager ZIndexManager}.
1297 * Components added in ths way will not participate in any layout, but will be rendered
1298 * upon first show in the way that {@link Ext.window.Window Window}s are.
1300 registerFloatingItem: function(cmp) {
1302 if (!me.floatingItems) {
1303 me.floatingItems = Ext.create('Ext.ZIndexManager', me);
1305 me.floatingItems.register(cmp);
1308 renderChildren: function () {
1310 layout = me.getComponentLayout();
1312 me.suspendLayout = true;
1313 layout.renderChildren();
1314 delete me.suspendLayout;
1317 frameCls: Ext.baseCSSPrefix + 'frame',
1319 frameIdRegex: /[-]frame\d+[TMB][LCR]$/,
1334 '<tpl if="top">',
1335 '<tpl if="left"><div id="{fgid}TL" 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>',
1336 '<tpl if="right"><div id="{fgid}TR" 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>',
1337 '<div id="{fgid}TC" 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>',
1338 '<tpl if="right"></div></tpl>',
1339 '<tpl if="left"></div></tpl>',
1341 '<tpl if="left"><div id="{fgid}ML" 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>',
1342 '<tpl if="right"><div id="{fgid}MR" 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>',
1343 '<div id="{fgid}MC" class="{frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl if="uiCls"><tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl></tpl>" role="presentation"></div>',
1344 '<tpl if="right"></div></tpl>',
1345 '<tpl if="left"></div></tpl>',
1346 '<tpl if="bottom">',
1347 '<tpl if="left"><div id="{fgid}BL" 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>',
1348 '<tpl if="right"><div id="{fgid}BR" 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>',
1349 '<div id="{fgid}BC" 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>',
1350 '<tpl if="right"></div></tpl>',
1351 '<tpl if="left"></div></tpl>',
1356 '<table><tbody>',
1357 '<tpl if="top">',
1359 '<tpl if="left"><td id="{fgid}TL" 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>',
1360 '<td id="{fgid}TC" 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>',
1361 '<tpl if="right"><td id="{fgid}TR" 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>',
1365 '<tpl if="left"><td id="{fgid}ML" 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>',
1366 '<td id="{fgid}MC" 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>',
1367 '<tpl if="right"><td id="{fgid}MR" 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>',
1369 '<tpl if="bottom">',
1371 '<tpl if="left"><td id="{fgid}BL" 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>',
1372 '<td id="{fgid}BC" 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>',
1373 '<tpl if="right"><td id="{fgid}BR" 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>',
1376 '</tbody></table>'
1379 <span id='Ext-AbstractComponent-method-initFrame'> /**
1382 initFrame : function() {
1383 if (Ext.supports.CSS3BorderRadius) {
1388 frameInfo = me.getFrameInfo(),
1389 frameWidth = frameInfo.width,
1390 frameTpl = me.getFrameTpl(frameInfo.table),
1394 // since we render id's into the markup and id's NEED to be unique, we have a
1395 // simple strategy for numbering their generations.
1396 me.frameGenId = frameGenId = (me.frameGenId || 0) + 1;
1397 frameGenId = me.id + '-frame' + frameGenId;
1399 // Here we render the frameTpl to this component. This inserts the 9point div or the table framing.
1400 frameTpl.insertFirst(me.el, Ext.apply({}, {
1404 frameCls: me.frameCls,
1405 baseCls: me.baseCls,
1406 frameWidth: frameWidth,
1407 top: !!frameInfo.top,
1408 left: !!frameInfo.left,
1409 right: !!frameInfo.right,
1410 bottom: !!frameInfo.bottom
1411 }, me.getFramePositions(frameInfo)));
1413 // The frameBody is returned in getTargetEl, so that layouts render items to the correct target.=
1414 me.frameBody = me.el.down('.' + me.frameCls + '-mc');
1416 // Clean out the childEls for the old frame elements (the majority of the els)
1417 me.removeChildEls(function (c) {
1418 return c.id && me.frameIdRegex.test(c.id);
1421 // Add the childEls for each of the new frame elements
1422 Ext.each(['TL','TC','TR','ML','MC','MR','BL','BC','BR'], function (suffix) {
1423 me.childEls.push({ name: 'frame' + suffix, id: frameGenId + suffix });
1428 updateFrame: function() {
1429 if (Ext.supports.CSS3BorderRadius) {
1434 wasTable = this.frameSize && this.frameSize.table,
1435 oldFrameTL = this.frameTL,
1436 oldFrameBL = this.frameBL,
1437 oldFrameML = this.frameML,
1438 oldFrameMC = this.frameMC,
1445 // Reapply render selectors
1455 this.applyRenderSelectors();
1457 // Store the class names set on the new mc
1458 newMCClassName = this.frameMC.dom.className;
1460 // Replace the new mc with the old mc
1461 oldFrameMC.insertAfter(this.frameMC);
1462 this.frameMC.remove();
1464 // Restore the reference to the old frame mc as the framebody
1465 this.frameBody = this.frameMC = oldFrameMC;
1467 // Apply the new mc classes to the old mc element
1468 oldFrameMC.dom.className = newMCClassName;
1470 // Remove the old framing
1472 me.el.query('> table')[1].remove();
1476 oldFrameTL.remove();
1479 oldFrameBL.remove();
1481 oldFrameML.remove();
1485 // We were framed but not anymore. Move all content from the old frame to the body
1489 else if (me.frame) {
1490 this.applyRenderSelectors();
1494 getFrameInfo: function() {
1495 if (Ext.supports.CSS3BorderRadius) {
1500 left = me.el.getStyle('background-position-x'),
1501 top = me.el.getStyle('background-position-y'),
1502 info, frameInfo = false, max;
1504 // Some browsers dont support background-position-x and y, so for those
1505 // browsers let's split background-position into two parts.
1506 if (!left && !top) {
1507 info = me.el.getStyle('background-position').split(' ');
1512 // We actually pass a string in the form of '[type][tl][tr]px [type][br][bl]px' as
1513 // the background position of this.el from the css to indicate to IE that this component needs
1514 // framing. We parse it here and change the markup accordingly.
1515 if (parseInt(left, 10) >= 1000000 && parseInt(top, 10) >= 1000000) {
1519 // Table markup starts with 110, div markup with 100.
1520 table: left.substr(0, 3) == '110',
1522 // Determine if we are dealing with a horizontal or vertical component
1523 vertical: top.substr(0, 3) == '110',
1525 // Get and parse the different border radius sizes
1526 top: max(left.substr(3, 2), left.substr(5, 2)),
1527 right: max(left.substr(5, 2), top.substr(3, 2)),
1528 bottom: max(top.substr(3, 2), top.substr(5, 2)),
1529 left: max(top.substr(5, 2), left.substr(3, 2))
1532 frameInfo.width = max(frameInfo.top, frameInfo.right, frameInfo.bottom, frameInfo.left);
1534 // Just to be sure we set the background image of the el to none.
1535 me.el.setStyle('background-image', 'none');
1538 // This happens when you set frame: true explicitly without using the x-frame mixin in sass.
1539 // This way IE can't figure out what sizes to use and thus framing can't work.
1540 if (me.frame === true && !frameInfo) {
1541 //<debug error>
1542 Ext.Error.raise("You have set frame: true explicity on this component while it doesn't have any " +
1543 "framing defined in the CSS template. In this case IE can't figure out what sizes " +
1544 "to use and thus framing on this component will be disabled.");
1548 me.frame = me.frame || !!frameInfo;
1549 me.frameSize = frameInfo || false;
1554 getFramePositions: function(frameInfo) {
1556 frameWidth = frameInfo.width,
1558 positions, tc, bc, ml, mr;
1560 if (frameInfo.vertical) {
1561 tc = '0 -' + (frameWidth * 0) + 'px';
1562 bc = '0 -' + (frameWidth * 1) + 'px';
1564 if (dock && dock == "right") {
1565 tc = 'right -' + (frameWidth * 0) + 'px';
1566 bc = 'right -' + (frameWidth * 1) + 'px';
1570 tl: '0 -' + (frameWidth * 0) + 'px',
1571 tr: '0 -' + (frameWidth * 1) + 'px',
1572 bl: '0 -' + (frameWidth * 2) + 'px',
1573 br: '0 -' + (frameWidth * 3) + 'px',
1575 ml: '-' + (frameWidth * 1) + 'px 0',
1582 ml = '-' + (frameWidth * 0) + 'px 0';
1585 if (dock && dock == "bottom") {
1587 mr = 'right bottom';
1591 tl: '0 -' + (frameWidth * 2) + 'px',
1592 tr: 'right -' + (frameWidth * 3) + 'px',
1593 bl: '0 -' + (frameWidth * 4) + 'px',
1594 br: 'right -' + (frameWidth * 5) + 'px',
1599 tc: '0 -' + (frameWidth * 0) + 'px',
1600 bc: '0 -' + (frameWidth * 1) + 'px'
1607 <span id='Ext-AbstractComponent-method-getFrameTpl'> /**
1610 getFrameTpl : function(table) {
1611 return table ? this.getTpl('frameTableTpl') : this.getTpl('frameTpl');
1614 <span id='Ext-AbstractComponent-method-initCls'> /**
1615 </span> * Creates an array of class names from the configurations to add to this Component's `el` on render.
1617 * Private, but (possibly) used by ComponentQuery for selection by class name if Component is not rendered.
1619 * @return {String[]} An array of class names with which the Component's element will be rendered.
1622 initCls: function() {
1626 cls.push(me.baseCls);
1628 //<deprecated since=0.99>
1629 if (Ext.isDefined(me.cmpCls)) {
1630 if (Ext.isDefined(Ext.global.console)) {
1631 Ext.global.console.warn('Ext.Component: cmpCls has been deprecated. Please use componentCls.');
1633 me.componentCls = me.cmpCls;
1636 //</deprecated>
1638 if (me.componentCls) {
1639 cls.push(me.componentCls);
1641 me.componentCls = me.baseCls;
1648 return cls.concat(me.additionalCls);
1651 <span id='Ext-AbstractComponent-method-setUI'> /**
1652 </span> * Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any
1653 * uiCls set on the component and rename them so they include the new UI
1654 * @param {String} ui The new UI for the component
1656 setUI: function(ui) {
1658 oldUICls = Ext.Array.clone(me.uiCls),
1664 //loop through all exisiting uiCls and update the ui in them
1665 for (i = 0; i < oldUICls.length; i++) {
1668 classes = classes.concat(me.removeClsWithUI(cls, true));
1672 if (classes.length) {
1673 me.removeCls(classes);
1676 //remove the UI from the element
1677 me.removeUIFromElement();
1682 //add the new UI to the elemend
1683 me.addUIToElement();
1685 //loop through all exisiting uiCls and update the ui in them
1687 for (i = 0; i < newUICls.length; i++) {
1689 classes = classes.concat(me.addClsWithUI(cls, true));
1692 if (classes.length) {
1697 <span id='Ext-AbstractComponent-method-addClsWithUI'> /**
1698 </span> * Adds a cls to the uiCls array, which will also call {@link #addUIClsToElement} and adds to all elements of this
1700 * @param {String/String[]} cls A string or an array of strings to add to the uiCls
1701 * @param {Object} skip (Boolean) skip True to skip adding it to the class and do it later (via the return)
1703 addClsWithUI: function(cls, skip) {
1708 if (!Ext.isArray(cls)) {
1712 for (i = 0; i < cls.length; i++) {
1713 if (cls[i] && !me.hasUICls(cls[i])) {
1714 me.uiCls = Ext.Array.clone(me.uiCls);
1715 me.uiCls.push(cls[i]);
1717 classes = classes.concat(me.addUIClsToElement(cls[i]));
1721 if (skip !== true) {
1728 <span id='Ext-AbstractComponent-method-removeClsWithUI'> /**
1729 </span> * Removes a cls to the uiCls array, which will also call {@link #removeUIClsFromElement} and removes it from all
1730 * elements of this component.
1731 * @param {String/String[]} cls A string or an array of strings to remove to the uiCls
1733 removeClsWithUI: function(cls, skip) {
1738 if (!Ext.isArray(cls)) {
1742 for (i = 0; i < cls.length; i++) {
1743 if (cls[i] && me.hasUICls(cls[i])) {
1744 me.uiCls = Ext.Array.remove(me.uiCls, cls[i]);
1746 classes = classes.concat(me.removeUIClsFromElement(cls[i]));
1750 if (skip !== true) {
1751 me.removeCls(classes);
1757 <span id='Ext-AbstractComponent-method-hasUICls'> /**
1758 </span> * Checks if there is currently a specified uiCls
1759 * @param {String} cls The cls to check
1761 hasUICls: function(cls) {
1763 uiCls = me.uiCls || [];
1765 return Ext.Array.contains(uiCls, cls);
1768 <span id='Ext-AbstractComponent-method-addUIClsToElement'> /**
1769 </span> * Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more
1770 * than just the components element.
1771 * @param {String} ui The UI to remove from the element
1773 addUIClsToElement: function(cls, force) {
1776 frameElementCls = me.frameElementCls;
1778 result.push(Ext.baseCSSPrefix + cls);
1779 result.push(me.baseCls + '-' + cls);
1780 result.push(me.baseCls + '-' + me.ui + '-' + cls);
1782 if (!force && me.frame && !Ext.supports.CSS3BorderRadius) {
1783 // define each element of the frame
1784 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1787 // loop through each of them, and if they are defined add the ui
1788 for (i = 0; i < els.length; i++) {
1789 el = me['frame' + els[i].toUpperCase()];
1790 classes = [me.baseCls + '-' + me.ui + '-' + els[i], me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i]];
1791 if (el && el.dom) {
1794 for (j = 0; j < classes.length; j++) {
1795 if (Ext.Array.indexOf(frameElementCls[els[i]], classes[j]) == -1) {
1796 frameElementCls[els[i]].push(classes[j]);
1803 me.frameElementCls = frameElementCls;
1808 <span id='Ext-AbstractComponent-method-removeUIClsFromElement'> /**
1809 </span> * Method which removes a specified UI + uiCls from the components element. The cls which is added to the element
1810 * will be: `this.baseCls + '-' + ui`
1811 * @param {String} ui The UI to add to the element
1813 removeUIClsFromElement: function(cls, force) {
1816 frameElementCls = me.frameElementCls;
1818 result.push(Ext.baseCSSPrefix + cls);
1819 result.push(me.baseCls + '-' + cls);
1820 result.push(me.baseCls + '-' + me.ui + '-' + cls);
1822 if (!force && me.frame && !Ext.supports.CSS3BorderRadius) {
1823 // define each element of the frame
1824 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1826 cls = me.baseCls + '-' + me.ui + '-' + cls + '-' + els[i];
1827 // loop through each of them, and if they are defined add the ui
1828 for (i = 0; i < els.length; i++) {
1829 el = me['frame' + els[i].toUpperCase()];
1830 if (el && el.dom) {
1833 Ext.Array.remove(frameElementCls[els[i]], cls);
1838 me.frameElementCls = frameElementCls;
1843 <span id='Ext-AbstractComponent-method-addUIToElement'> /**
1844 </span> * Method which adds a specified UI to the components element.
1847 addUIToElement: function(force) {
1849 frameElementCls = me.frameElementCls;
1851 me.addCls(me.baseCls + '-' + me.ui);
1853 if (me.frame && !Ext.supports.CSS3BorderRadius) {
1854 // define each element of the frame
1855 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1858 // loop through each of them, and if they are defined add the ui
1859 for (i = 0; i < els.length; i++) {
1860 el = me['frame' + els[i].toUpperCase()];
1861 cls = me.baseCls + '-' + me.ui + '-' + els[i];
1865 if (!Ext.Array.contains(frameElementCls[els[i]], cls)) {
1866 frameElementCls[els[i]].push(cls);
1873 <span id='Ext-AbstractComponent-method-removeUIFromElement'> /**
1874 </span> * Method which removes a specified UI from the components element.
1877 removeUIFromElement: function() {
1879 frameElementCls = me.frameElementCls;
1881 me.removeCls(me.baseCls + '-' + me.ui);
1883 if (me.frame && !Ext.supports.CSS3BorderRadius) {
1884 // define each element of the frame
1885 var els = ['tl', 'tc', 'tr', 'ml', 'mc', 'mr', 'bl', 'bc', 'br'],
1888 // loop through each of them, and if they are defined add the ui
1889 for (i = 0; i < els.length; i++) {
1890 el = me['frame' + els[i].toUpperCase()];
1891 cls = me.baseCls + '-' + me.ui + '-' + els[i];
1896 Ext.Array.remove(frameElementCls[els[i]], cls);
1902 getElConfig : function() {
1903 if (Ext.isString(this.autoEl)) {
1909 var result = this.autoEl || {tag: 'div'};
1910 result.id = this.id;
1914 <span id='Ext-AbstractComponent-method-getInsertPosition'> /**
1915 </span> * This function takes the position argument passed to onRender and returns a DOM element that you can use in the
1917 * @param {String/Number/Ext.Element/HTMLElement} position Index, element id or element you want to put this
1919 * @return {HTMLElement} DOM element that you can use in the insertBefore
1921 getInsertPosition: function(position) {
1922 // Convert the position to an element to insert before
1923 if (position !== undefined) {
1924 if (Ext.isNumber(position)) {
1925 position = this.container.dom.childNodes[position];
1928 position = Ext.getDom(position);
1935 <span id='Ext-AbstractComponent-method-initContainer'> /**
1936 </span> * Adds ctCls to container.
1937 * @return {Ext.Element} The initialized container
1940 initContainer: function(container) {
1943 // If you render a component specifying the el, we get the container
1944 // of the el, and make sure we dont move the el around in the dom
1945 // during the render
1946 if (!container && me.el) {
1947 container = me.el.dom.parentNode;
1948 me.allowDomMove = false;
1951 me.container = Ext.get(container);
1954 me.container.addCls(me.ctCls);
1957 return me.container;
1960 <span id='Ext-AbstractComponent-method-initRenderData'> /**
1961 </span> * Initialized the renderData to be used when rendering the renderTpl.
1962 * @return {Object} Object with keys and values that are going to be applied to the renderTpl
1965 initRenderData: function() {
1968 return Ext.applyIf(me.renderData, {
1972 baseCls: me.baseCls,
1973 componentCls: me.componentCls,
1978 <span id='Ext-AbstractComponent-method-getTpl'> /**
1981 getTpl: function(name) {
1983 prototype = me.self.prototype,
1987 if (me.hasOwnProperty(name)) {
1989 if (tpl && !(tpl instanceof Ext.XTemplate)) {
1990 me[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', tpl);
1996 if (!(prototype[name] instanceof Ext.XTemplate)) {
1997 ownerPrototype = prototype;
2000 if (ownerPrototype.hasOwnProperty(name)) {
2001 tpl = ownerPrototype[name];
2002 if (tpl && !(tpl instanceof Ext.XTemplate)) {
2003 ownerPrototype[name] = Ext.ClassManager.dynInstantiate('Ext.XTemplate', tpl);
2008 ownerPrototype = ownerPrototype.superclass;
2009 } while (ownerPrototype);
2012 return prototype[name];
2015 <span id='Ext-AbstractComponent-method-initRenderTpl'> /**
2016 </span> * Initializes the renderTpl.
2017 * @return {Ext.XTemplate} The renderTpl XTemplate instance.
2020 initRenderTpl: function() {
2021 return this.getTpl('renderTpl');
2024 <span id='Ext-AbstractComponent-method-initStyles'> /**
2025 </span> * Converts style definitions to String.
2026 * @return {String} A CSS style string with style, padding, margin and border.
2029 initStyles: function() {
2032 Element = Ext.Element;
2034 if (Ext.isString(me.style)) {
2035 style = Element.parseStyles(me.style);
2037 style = Ext.apply({}, me.style);
2040 // Convert the padding, margin and border properties from a space seperated string
2041 // into a proper style string
2042 if (me.padding !== undefined) {
2043 style.padding = Element.unitizeBox((me.padding === true) ? 5 : me.padding);
2046 if (me.margin !== undefined) {
2047 style.margin = Element.unitizeBox((me.margin === true) ? 5 : me.margin);
2054 <span id='Ext-AbstractComponent-method-initContent'> /**
2055 </span> * Initializes this components contents. It checks for the properties html, contentEl and tpl/data.
2058 initContent: function() {
2060 target = me.getTargetEl(),
2065 target.update(Ext.DomHelper.markup(me.html));
2070 contentEl = Ext.get(me.contentEl);
2071 pre = Ext.baseCSSPrefix;
2072 contentEl.removeCls([pre + 'hidden', pre + 'hide-display', pre + 'hide-offsets', pre + 'hide-nosize']);
2073 target.appendChild(contentEl.dom);
2077 // Make sure this.tpl is an instantiated XTemplate
2078 if (!me.tpl.isTemplate) {
2079 me.tpl = Ext.create('Ext.XTemplate', me.tpl);
2083 me.tpl[me.tplWriteMode](target, me.data);
2090 initEvents : function() {
2092 afterRenderEvents = me.afterRenderEvents,
2095 fn = function(listeners){
2096 me.mon(el, listeners);
2098 if (afterRenderEvents) {
2099 for (property in afterRenderEvents) {
2100 if (afterRenderEvents.hasOwnProperty(property)) {
2102 if (el && el.on) {
2103 Ext.each(afterRenderEvents[property], fn);
2110 <span id='Ext-AbstractComponent-method-addChildEls'> /**
2111 </span> * Adds each argument passed to this method to the {@link #childEls} array.
2113 addChildEls: function () {
2115 childEls = me.childEls || (me.childEls = []);
2117 childEls.push.apply(childEls, arguments);
2120 <span id='Ext-AbstractComponent-method-removeChildEls'> /**
2121 </span> * Removes items in the childEls array based on the return value of a supplied test function. The function is called
2122 * with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is
2124 * @param {Function} testFn The test function.
2126 removeChildEls: function (testFn) {
2129 keepers = (me.childEls = []),
2132 for (i = 0, n = old.length; i < n; ++i) {
2140 <span id='Ext-AbstractComponent-method-applyRenderSelectors'> /**
2141 </span> * Sets references to elements inside the component. This applies {@link #renderSelectors}
2142 * as well as {@link #childEls}.
2145 applyRenderSelectors: function() {
2147 childEls = me.childEls,
2148 selectors = me.renderSelectors,
2151 baseId, childName, childId, i, selector;
2154 baseId = me.id + '-';
2155 for (i = childEls.length; i--; ) {
2156 childName = childId = childEls[i];
2157 if (typeof(childName) != 'string') {
2158 childId = childName.id || (baseId + childName.itemId);
2159 childName = childName.name;
2161 childId = baseId + childId;
2164 // We don't use Ext.get because that is 3x (or more) slower on IE6-8. Since
2165 // we know the el's are children of our el we use getById instead:
2166 me[childName] = el.getById(childId);
2170 // We still support renderSelectors. There are a few places in the framework that
2171 // need them and they are a documented part of the API. In fact, we support mixing
2172 // childEls and renderSelectors (no reason not to).
2174 for (selector in selectors) {
2175 if (selectors.hasOwnProperty(selector) && selectors[selector]) {
2176 me[selector] = Ext.get(Ext.DomQuery.selectNode(selectors[selector], dom));
2182 <span id='Ext-AbstractComponent-method-is'> /**
2183 </span> * Tests whether this Component matches the selector string.
2184 * @param {String} selector The selector string to test against.
2185 * @return {Boolean} True if this Component matches the selector.
2187 is: function(selector) {
2188 return Ext.ComponentQuery.is(this, selector);
2191 <span id='Ext-AbstractComponent-method-up'> /**
2192 </span> * Walks up the `ownerCt` axis looking for an ancestor Container which matches the passed simple selector.
2196 * var owningTabPanel = grid.up('tabpanel');
2198 * @param {String} [selector] The simple selector to test.
2199 * @return {Ext.container.Container} The matching ancestor Container (or `undefined` if no match was found).
2201 up: function(selector) {
2202 var result = this.ownerCt;
2204 for (; result; result = result.ownerCt) {
2205 if (Ext.ComponentQuery.is(result, selector)) {
2213 <span id='Ext-AbstractComponent-method-nextSibling'> /**
2214 </span> * Returns the next sibling of this Component.
2216 * Optionally selects the next sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery} selector.
2218 * May also be refered to as **`next()`**
2220 * Note that this is limited to siblings, and if no siblings of the item match, `null` is returned. Contrast with
2222 * @param {String} [selector] A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following items.
2223 * @return {Ext.Component} The next sibling (or the next sibling which matches the selector).
2224 * Returns null if there is no matching sibling.
2226 nextSibling: function(selector) {
2227 var o = this.ownerCt, it, last, idx, c;
2230 idx = it.indexOf(this) + 1;
2233 for (last = it.getCount(); idx < last; idx++) {
2234 if ((c = it.getAt(idx)).is(selector)) {
2239 if (idx < it.getCount()) {
2240 return it.getAt(idx);
2248 <span id='Ext-AbstractComponent-method-previousSibling'> /**
2249 </span> * Returns the previous sibling of this Component.
2251 * Optionally selects the previous sibling which matches the passed {@link Ext.ComponentQuery ComponentQuery}
2254 * May also be refered to as **`prev()`**
2256 * Note that this is limited to siblings, and if no siblings of the item match, `null` is returned. Contrast with
2257 * {@link #previousNode}
2258 * @param {String} [selector] A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding items.
2259 * @return {Ext.Component} The previous sibling (or the previous sibling which matches the selector).
2260 * Returns null if there is no matching sibling.
2262 previousSibling: function(selector) {
2263 var o = this.ownerCt, it, idx, c;
2266 idx = it.indexOf(this);
2269 for (--idx; idx >= 0; idx--) {
2270 if ((c = it.getAt(idx)).is(selector)) {
2276 return it.getAt(--idx);
2284 <span id='Ext-AbstractComponent-method-previousNode'> /**
2285 </span> * Returns the previous node in the Component tree in tree traversal order.
2287 * Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the
2288 * tree in reverse order to attempt to find a match. Contrast with {@link #previousSibling}.
2289 * @param {String} [selector] A {@link Ext.ComponentQuery ComponentQuery} selector to filter the preceding nodes.
2290 * @return {Ext.Component} The previous node (or the previous node which matches the selector).
2291 * Returns null if there is no matching node.
2293 previousNode: function(selector, includeSelf) {
2298 // If asked to include self, test me
2299 if (includeSelf && node.is(selector)) {
2303 result = this.prev(selector);
2309 for (it = node.ownerCt.items.items, i = Ext.Array.indexOf(it, node) - 1; i > -1; i--) {
2311 result = it[i].query(selector);
2312 result = result[result.length - 1];
2318 return node.ownerCt.previousNode(selector, true);
2322 <span id='Ext-AbstractComponent-method-nextNode'> /**
2323 </span> * Returns the next node in the Component tree in tree traversal order.
2325 * Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the
2326 * tree to attempt to find a match. Contrast with {@link #nextSibling}.
2327 * @param {String} [selector] A {@link Ext.ComponentQuery ComponentQuery} selector to filter the following nodes.
2328 * @return {Ext.Component} The next node (or the next node which matches the selector).
2329 * Returns null if there is no matching node.
2331 nextNode: function(selector, includeSelf) {
2336 // If asked to include self, test me
2337 if (includeSelf && node.is(selector)) {
2341 result = this.next(selector);
2347 for (it = node.ownerCt.items, i = it.indexOf(node) + 1, it = it.items, len = it.length; i < len; i++) {
2349 result = it[i].down(selector);
2355 return node.ownerCt.nextNode(selector);
2359 <span id='Ext-AbstractComponent-method-getId'> /**
2360 </span> * Retrieves the id of this component. Will autogenerate an id if one has not already been set.
2363 getId : function() {
2364 return this.id || (this.id = 'ext-comp-' + (this.getAutoId()));
2367 getItemId : function() {
2368 return this.itemId || this.id;
2371 <span id='Ext-AbstractComponent-method-getEl'> /**
2372 </span> * Retrieves the top level element representing this component.
2373 * @return {Ext.core.Element}
2375 getEl : function() {
2379 <span id='Ext-AbstractComponent-method-getTargetEl'> /**
2380 </span> * This is used to determine where to insert the 'html', 'contentEl' and 'items' in this component.
2383 getTargetEl: function() {
2384 return this.frameBody || this.el;
2387 <span id='Ext-AbstractComponent-method-isXType'> /**
2388 </span> * Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended
2389 * from the xtype (default) or whether it is directly of the xtype specified (shallow = true).
2391 * **If using your own subclasses, be aware that a Component must register its own xtype to participate in
2392 * determination of inherited xtypes.**
2394 * For a list of all available xtypes, see the {@link Ext.Component} header.
2398 * var t = new Ext.form.field.Text();
2399 * var isText = t.isXType('textfield'); // true
2400 * var isBoxSubclass = t.isXType('field'); // true, descended from Ext.form.field.Base
2401 * var isBoxInstance = t.isXType('field', true); // false, not a direct Ext.form.field.Base instance
2403 * @param {String} xtype The xtype to check for this Component
2404 * @param {Boolean} [shallow=false] True to check whether this Component is directly of the specified xtype, false to
2405 * check whether this Component is descended from the xtype.
2406 * @return {Boolean} True if this component descends from the specified xtype, false otherwise.
2408 isXType: function(xtype, shallow) {
2409 //assume a string by default
2410 if (Ext.isFunction(xtype)) {
2411 xtype = xtype.xtype;
2412 //handle being passed the class, e.g. Ext.Component
2413 } else if (Ext.isObject(xtype)) {
2414 xtype = xtype.statics().xtype;
2415 //handle being passed an instance
2418 return !shallow ? ('/' + this.getXTypes() + '/').indexOf('/' + xtype + '/') != -1: this.self.xtype == xtype;
2421 <span id='Ext-AbstractComponent-method-getXTypes'> /**
2422 </span> * Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the
2423 * {@link Ext.Component} header.
2425 * **If using your own subclasses, be aware that a Component must register its own xtype to participate in
2426 * determination of inherited xtypes.**
2430 * var t = new Ext.form.field.Text();
2431 * alert(t.getXTypes()); // alerts 'component/field/textfield'
2433 * @return {String} The xtype hierarchy string
2435 getXTypes: function() {
2436 var self = this.self,
2437 xtypes, parentPrototype, parentXtypes;
2441 parentPrototype = this;
2443 while (parentPrototype) {
2444 parentXtypes = parentPrototype.xtypes;
2446 if (parentXtypes !== undefined) {
2447 xtypes.unshift.apply(xtypes, parentXtypes);
2450 parentPrototype = parentPrototype.superclass;
2453 self.xtypeChain = xtypes;
2454 self.xtypes = xtypes.join('/');
2460 <span id='Ext-AbstractComponent-method-update'> /**
2461 </span> * Update the content area of a component.
2462 * @param {String/Object} htmlOrData If this component has been configured with a template via the tpl config then
2463 * it will use this argument as data to populate the template. If this component was not configured with a template,
2464 * the components content area will be updated via Ext.Element update
2465 * @param {Boolean} [loadScripts=false] Only legitimate when using the html configuration.
2466 * @param {Function} [callback] Only legitimate when using the html configuration. Callback to execute when
2467 * scripts have finished loading
2469 update : function(htmlOrData, loadScripts, cb) {
2472 if (me.tpl && !Ext.isString(htmlOrData)) {
2473 me.data = htmlOrData;
2475 me.tpl[me.tplWriteMode](me.getTargetEl(), htmlOrData || {});
2478 me.html = Ext.isObject(htmlOrData) ? Ext.DomHelper.markup(htmlOrData) : htmlOrData;
2480 me.getTargetEl().update(me.html, loadScripts, cb);
2485 me.doComponentLayout();
2489 <span id='Ext-AbstractComponent-method-setVisible'> /**
2490 </span> * Convenience function to hide or show this component by boolean.
2491 * @param {Boolean} visible True to show, false to hide
2492 * @return {Ext.Component} this
2494 setVisible : function(visible) {
2495 return this[visible ? 'show': 'hide']();
2498 <span id='Ext-AbstractComponent-method-isVisible'> /**
2499 </span> * Returns true if this component is visible.
2501 * @param {Boolean} [deep=false] Pass `true` to interrogate the visibility status of all parent Containers to
2502 * determine whether this Component is truly visible to the user.
2504 * Generally, to determine whether a Component is hidden, the no argument form is needed. For example when creating
2505 * dynamically laid out UIs in a hidden Container before showing them.
2507 * @return {Boolean} True if this component is visible, false otherwise.
2509 isVisible: function(deep) {
2512 visible = !me.hidden,
2513 ancestor = me.ownerCt;
2515 // Clear hiddenOwnerCt property
2516 me.hiddenAncestor = false;
2521 if (deep && visible && me.rendered && ancestor) {
2523 // If any ancestor is hidden, then this is hidden.
2524 // If an ancestor Panel (only Panels have a collapse method) is collapsed,
2525 // then its layoutTarget (body) is hidden, so this is hidden unless its within a
2526 // docked item; they are still visible when collapsed (Unless they themseves are hidden)
2527 if (ancestor.hidden || (ancestor.collapsed &&
2528 !(ancestor.getDockedItems && Ext.Array.contains(ancestor.getDockedItems(), child)))) {
2529 // Store hiddenOwnerCt property if needed
2530 me.hiddenAncestor = ancestor;
2535 ancestor = ancestor.ownerCt;
2541 <span id='Ext-AbstractComponent-method-enable'> /**
2542 </span> * Enable the component
2543 * @param {Boolean} [silent=false] Passing true will supress the 'enable' event from being fired.
2545 enable: function(silent) {
2549 me.el.removeCls(me.disabledCls);
2550 me.el.dom.disabled = false;
2554 me.disabled = false;
2556 if (silent !== true) {
2557 me.fireEvent('enable', me);
2563 <span id='Ext-AbstractComponent-method-disable'> /**
2564 </span> * Disable the component.
2565 * @param {Boolean} [silent=false] Passing true will supress the 'disable' event from being fired.
2567 disable: function(silent) {
2571 me.el.addCls(me.disabledCls);
2572 me.el.dom.disabled = true;
2578 if (silent !== true) {
2579 me.fireEvent('disable', me);
2586 onEnable: function() {
2587 if (this.maskOnDisable) {
2593 onDisable : function() {
2594 if (this.maskOnDisable) {
2599 <span id='Ext-AbstractComponent-method-isDisabled'> /**
2600 </span> * Method to determine whether this Component is currently disabled.
2601 * @return {Boolean} the disabled state of this Component.
2603 isDisabled : function() {
2604 return this.disabled;
2607 <span id='Ext-AbstractComponent-method-setDisabled'> /**
2608 </span> * Enable or disable the component.
2609 * @param {Boolean} disabled True to disable.
2611 setDisabled : function(disabled) {
2612 return this[disabled ? 'disable': 'enable']();
2615 <span id='Ext-AbstractComponent-method-isHidden'> /**
2616 </span> * Method to determine whether this Component is currently set to hidden.
2617 * @return {Boolean} the hidden state of this Component.
2619 isHidden : function() {
2623 <span id='Ext-AbstractComponent-method-addCls'> /**
2624 </span> * Adds a CSS class to the top level element representing this component.
2625 * @param {String} cls The CSS class name to add
2626 * @return {Ext.Component} Returns the Component to allow method chaining.
2628 addCls : function(className) {
2633 if (!Ext.isArray(className)){
2634 className = className.replace(me.trimRe, '').split(me.spacesRe);
2637 me.el.addCls(className);
2640 me.additionalCls = Ext.Array.unique(me.additionalCls.concat(className));
2645 <span id='Ext-AbstractComponent-method-addClass'> /**
2646 </span> * Adds a CSS class to the top level element representing this component.
2647 * @param {String} cls The CSS class name to add
2648 * @return {Ext.Component} Returns the Component to allow method chaining.
2650 addClass : function() {
2651 return this.addCls.apply(this, arguments);
2654 <span id='Ext-AbstractComponent-method-removeCls'> /**
2655 </span> * Removes a CSS class from the top level element representing this component.
2656 * @param {Object} className
2657 * @return {Ext.Component} Returns the Component to allow method chaining.
2659 removeCls : function(className) {
2665 if (!Ext.isArray(className)){
2666 className = className.replace(me.trimRe, '').split(me.spacesRe);
2669 me.el.removeCls(className);
2671 else if (me.additionalCls.length) {
2672 Ext.each(className, function(cls) {
2673 Ext.Array.remove(me.additionalCls, cls);
2680 removeClass : function() {
2681 if (Ext.isDefined(Ext.global.console)) {
2682 Ext.global.console.warn('Ext.Component: removeClass has been deprecated. Please use removeCls.');
2684 return this.removeCls.apply(this, arguments);
2688 addOverCls: function() {
2691 me.el.addCls(me.overCls);
2695 removeOverCls: function() {
2696 this.el.removeCls(this.overCls);
2699 addListener : function(element, listeners, scope, options) {
2704 if (Ext.isString(element) && (Ext.isObject(listeners) || options && options.element)) {
2705 if (options.element) {
2709 listeners[element] = fn;
2710 element = options.element;
2712 listeners.scope = scope;
2715 for (option in options) {
2716 if (options.hasOwnProperty(option)) {
2717 if (me.eventOptionsRe.test(option)) {
2718 listeners[option] = options[option];
2724 // At this point we have a variable called element,
2725 // and a listeners object that can be passed to on
2726 if (me[element] && me[element].on) {
2727 me.mon(me[element], listeners);
2729 me.afterRenderEvents = me.afterRenderEvents || {};
2730 if (!me.afterRenderEvents[element]) {
2731 me.afterRenderEvents[element] = [];
2733 me.afterRenderEvents[element].push(listeners);
2737 return me.mixins.observable.addListener.apply(me, arguments);
2741 removeManagedListenerItem: function(isClear, managedListener, item, ename, fn, scope){
2743 element = managedListener.options ? managedListener.options.element : null;
2746 element = me[element];
2747 if (element && element.un) {
2748 if (isClear || (managedListener.item === item && managedListener.ename === ename && (!fn || managedListener.fn === fn) && (!scope || managedListener.scope === scope))) {
2749 element.un(managedListener.ename, managedListener.fn, managedListener.scope);
2751 Ext.Array.remove(me.managedListeners, managedListener);
2756 return me.mixins.observable.removeManagedListenerItem.apply(me, arguments);
2760 <span id='Ext-AbstractComponent-method-getBubbleTarget'> /**
2761 </span> * Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.
2762 * @return {Ext.container.Container} the Container which owns this Component.
2764 getBubbleTarget : function() {
2765 return this.ownerCt;
2768 <span id='Ext-AbstractComponent-method-isFloating'> /**
2769 </span> * Method to determine whether this Component is floating.
2770 * @return {Boolean} the floating state of this component.
2772 isFloating : function() {
2773 return this.floating;
2776 <span id='Ext-AbstractComponent-method-isDraggable'> /**
2777 </span> * Method to determine whether this Component is draggable.
2778 * @return {Boolean} the draggable state of this component.
2780 isDraggable : function() {
2781 return !!this.draggable;
2784 <span id='Ext-AbstractComponent-method-isDroppable'> /**
2785 </span> * Method to determine whether this Component is droppable.
2786 * @return {Boolean} the droppable state of this component.
2788 isDroppable : function() {
2789 return !!this.droppable;
2792 <span id='Ext-AbstractComponent-method-onAdded'> /**
2794 * Method to manage awareness of when components are added to their
2795 * respective Container, firing an added event.
2796 * References are established at add time rather than at render time.
2797 * @param {Ext.container.Container} container Container which holds the component
2798 * @param {Number} pos Position at which the component was added
2800 onAdded : function(container, pos) {
2801 this.ownerCt = container;
2802 this.fireEvent('added', this, container, pos);
2805 <span id='Ext-AbstractComponent-method-onRemoved'> /**
2807 * Method to manage awareness of when components are removed from their
2808 * respective Container, firing an removed event. References are properly
2809 * cleaned up after removing a component from its owning container.
2811 onRemoved : function() {
2814 me.fireEvent('removed', me, me.ownerCt);
2819 beforeDestroy : Ext.emptyFn,
2822 onResize : Ext.emptyFn,
2824 <span id='Ext-AbstractComponent-method-setSize'> /**
2825 </span> * Sets the width and height of this Component. This method fires the {@link #resize} event. This method can accept
2826 * either width and height as separate arguments, or you can pass a size object like `{width:10, height:20}`.
2828 * @param {Number/String/Object} width The new width to set. This may be one of:
2830 * - A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
2831 * - A String used to set the CSS width style.
2832 * - A size object in the format `{width: widthValue, height: heightValue}`.
2833 * - `undefined` to leave the width unchanged.
2835 * @param {Number/String} height The new height to set (not required if a size object is passed as the first arg).
2836 * This may be one of:
2838 * - A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
2839 * - A String used to set the CSS height style. Animation may **not** be used.
2840 * - `undefined` to leave the height unchanged.
2842 * @return {Ext.Component} this
2844 setSize : function(width, height) {
2848 // support for standard size objects
2849 if (Ext.isObject(width)) {
2850 height = width.height;
2851 width = width.width;
2854 // Constrain within configured maxima
2855 if (Ext.isNumber(width)) {
2856 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2858 if (Ext.isNumber(height)) {
2859 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2862 if (!me.rendered || !me.isVisible()) {
2863 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2864 if (me.hiddenAncestor) {
2865 layoutCollection = me.hiddenAncestor.layoutOnShow;
2866 layoutCollection.remove(me);
2867 layoutCollection.add(me);
2875 me.width = (width !== undefined) ? width : me.width;
2876 me.height = (height !== undefined) ? height : me.height;
2880 me.doComponentLayout(width, height, true);
2885 isFixedWidth: function() {
2887 layoutManagedWidth = me.layoutManagedWidth;
2889 if (Ext.isDefined(me.width) || layoutManagedWidth == 1) {
2892 if (layoutManagedWidth == 2) {
2895 return (me.ownerCt && me.ownerCt.isFixedWidth());
2898 isFixedHeight: function() {
2900 layoutManagedHeight = me.layoutManagedHeight;
2902 if (Ext.isDefined(me.height) || layoutManagedHeight == 1) {
2905 if (layoutManagedHeight == 2) {
2908 return (me.ownerCt && me.ownerCt.isFixedHeight());
2911 setCalculatedSize : function(width, height, callingContainer) {
2915 // support for standard size objects
2916 if (Ext.isObject(width)) {
2917 callingContainer = width.ownerCt;
2918 height = width.height;
2919 width = width.width;
2922 // Constrain within configured maxima
2923 if (Ext.isNumber(width)) {
2924 width = Ext.Number.constrain(width, me.minWidth, me.maxWidth);
2926 if (Ext.isNumber(height)) {
2927 height = Ext.Number.constrain(height, me.minHeight, me.maxHeight);
2930 if (!me.rendered || !me.isVisible()) {
2931 // If an ownerCt is hidden, add my reference onto the layoutOnShow stack. Set the needsLayout flag.
2932 if (me.hiddenAncestor) {
2933 layoutCollection = me.hiddenAncestor.layoutOnShow;
2934 layoutCollection.remove(me);
2935 layoutCollection.add(me);
2941 ownerCt: callingContainer
2945 me.doComponentLayout(width, height, false, callingContainer);
2950 <span id='Ext-AbstractComponent-method-doComponentLayout'> /**
2951 </span> * This method needs to be called whenever you change something on this component that requires the Component's
2952 * layout to be recalculated.
2953 * @param {Object} width
2954 * @param {Object} height
2955 * @param {Object} isSetSize
2956 * @param {Object} callingContainer
2957 * @return {Ext.container.Container} this
2959 doComponentLayout : function(width, height, isSetSize, callingContainer) {
2961 componentLayout = me.getComponentLayout(),
2962 lastComponentSize = componentLayout.lastComponentSize || {
2967 // collapsed state is not relevant here, so no testing done.
2968 // Only Panels have a collapse method, and that just sets the width/height such that only
2969 // a single docked Header parallel to the collapseTo side are visible, and the Panel body is hidden.
2970 if (me.rendered && componentLayout) {
2971 // If no width passed, then only insert a value if the Component is NOT ALLOWED to autowidth itself.
2972 if (!Ext.isDefined(width)) {
2973 if (me.isFixedWidth()) {
2974 width = Ext.isDefined(me.width) ? me.width : lastComponentSize.width;
2977 // If no height passed, then only insert a value if the Component is NOT ALLOWED to autoheight itself.
2978 if (!Ext.isDefined(height)) {
2979 if (me.isFixedHeight()) {
2980 height = Ext.isDefined(me.height) ? me.height : lastComponentSize.height;
2989 componentLayout.layout(width, height, isSetSize, callingContainer);
2995 <span id='Ext-AbstractComponent-method-forceComponentLayout'> /**
2996 </span> * Forces this component to redo its componentLayout.
2998 forceComponentLayout: function () {
2999 this.doComponentLayout();
3003 setComponentLayout : function(layout) {
3004 var currentLayout = this.componentLayout;
3005 if (currentLayout && currentLayout.isLayout && currentLayout != layout) {
3006 currentLayout.setOwner(null);
3008 this.componentLayout = layout;
3009 layout.setOwner(this);
3012 getComponentLayout : function() {
3015 if (!me.componentLayout || !me.componentLayout.isLayout) {
3016 me.setComponentLayout(Ext.layout.Layout.create(me.componentLayout, 'autocomponent'));
3018 return me.componentLayout;
3021 <span id='Ext-AbstractComponent-method-afterComponentLayout'> /**
3022 </span> * Occurs after componentLayout is run.
3023 * @param {Number} adjWidth The box-adjusted width that was set
3024 * @param {Number} adjHeight The box-adjusted height that was set
3025 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
3026 * @param {Ext.Component} callingContainer Container requesting the layout. Only used when isSetSize is false.
3028 afterComponentLayout: function(width, height, isSetSize, callingContainer) {
3030 layout = me.componentLayout,
3031 oldSize = me.preLayoutSize;
3033 ++me.componentLayoutCounter;
3034 if (!oldSize || ((width !== oldSize.width) || (height !== oldSize.height))) {
3035 me.fireEvent('resize', me, width, height);
3039 <span id='Ext-AbstractComponent-method-beforeComponentLayout'> /**
3040 </span> * Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from
3042 * @param {Number} adjWidth The box-adjusted width that was set
3043 * @param {Number} adjHeight The box-adjusted height that was set
3044 * @param {Boolean} isSetSize Whether or not the height/width are stored on the component permanently
3045 * @param {Ext.Component} callingContainer Container requesting sent the layout. Only used when isSetSize is false.
3047 beforeComponentLayout: function(width, height, isSetSize, callingContainer) {
3048 this.preLayoutSize = this.componentLayout.lastComponentSize;
3052 <span id='Ext-AbstractComponent-method-setPosition'> /**
3053 </span> * Sets the left and top of the component. To set the page XY position instead, use
3054 * {@link Ext.Component#setPagePosition setPagePosition}. This method fires the {@link #move} event.
3055 * @param {Number} left The new left
3056 * @param {Number} top The new top
3057 * @return {Ext.Component} this
3059 setPosition : function(x, y) {
3062 if (Ext.isObject(x)) {
3071 if (x !== undefined || y !== undefined) {
3073 me.onPosition(x, y);
3074 me.fireEvent('move', me, x, y);
3079 <span id='Ext-AbstractComponent-property-onPosition'> /**
3081 * Called after the component is moved, this method is empty by default but can be implemented by any
3082 * subclass that needs to perform custom logic after a move occurs.
3083 * @param {Number} x The new x position
3084 * @param {Number} y The new y position
3086 onPosition: Ext.emptyFn,
3088 <span id='Ext-AbstractComponent-method-setWidth'> /**
3089 </span> * Sets the width of the component. This method fires the {@link #resize} event.
3091 * @param {Number} width The new width to setThis may be one of:
3093 * - A Number specifying the new width in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
3094 * - A String used to set the CSS width style.
3096 * @return {Ext.Component} this
3098 setWidth : function(width) {
3099 return this.setSize(width);
3102 <span id='Ext-AbstractComponent-method-setHeight'> /**
3103 </span> * Sets the height of the component. This method fires the {@link #resize} event.
3105 * @param {Number} height The new height to set. This may be one of:
3107 * - A Number specifying the new height in the {@link #getEl Element}'s {@link Ext.Element#defaultUnit}s (by default, pixels).
3108 * - A String used to set the CSS height style.
3109 * - _undefined_ to leave the height unchanged.
3111 * @return {Ext.Component} this
3113 setHeight : function(height) {
3114 return this.setSize(undefined, height);
3117 <span id='Ext-AbstractComponent-method-getSize'> /**
3118 </span> * Gets the current size of the component's underlying element.
3119 * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
3121 getSize : function() {
3122 return this.el.getSize();
3125 <span id='Ext-AbstractComponent-method-getWidth'> /**
3126 </span> * Gets the current width of the component's underlying element.
3129 getWidth : function() {
3130 return this.el.getWidth();
3133 <span id='Ext-AbstractComponent-method-getHeight'> /**
3134 </span> * Gets the current height of the component's underlying element.
3137 getHeight : function() {
3138 return this.el.getHeight();
3141 <span id='Ext-AbstractComponent-method-getLoader'> /**
3142 </span> * Gets the {@link Ext.ComponentLoader} for this Component.
3143 * @return {Ext.ComponentLoader} The loader instance, null if it doesn't exist.
3145 getLoader: function(){
3147 autoLoad = me.autoLoad ? (Ext.isObject(me.autoLoad) ? me.autoLoad : {url: me.autoLoad}) : null,
3148 loader = me.loader || autoLoad;
3151 if (!loader.isLoader) {
3152 me.loader = Ext.create('Ext.ComponentLoader', Ext.apply({
3157 loader.setTarget(me);
3165 <span id='Ext-AbstractComponent-method-setLoading'> /**
3166 </span> * This method allows you to show or hide a LoadMask on top of this component.
3168 * @param {Boolean/Object/String} load True to show the default LoadMask, a config object that will be passed to the
3169 * LoadMask constructor, or a message String to show. False to hide the current LoadMask.
3170 * @param {Boolean} [targetEl=false] True to mask the targetEl of this Component instead of the `this.el`. For example,
3171 * setting this to true on a Panel will cause only the body to be masked.
3172 * @return {Ext.LoadMask} The LoadMask instance that has just been shown.
3174 setLoading : function(load, targetEl) {
3179 if (load !== false && !me.collapsed) {
3180 if (Ext.isObject(load)) {
3183 else if (Ext.isString(load)) {
3184 config = {msg: load};
3189 me.loadMask = me.loadMask || Ext.create('Ext.LoadMask', targetEl ? me.getTargetEl() : me.el, config);
3191 } else if (me.loadMask) {
3192 Ext.destroy(me.loadMask);
3200 <span id='Ext-AbstractComponent-method-setDocked'> /**
3201 </span> * Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part
3202 * of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)
3203 * @param {Object} dock The dock position.
3204 * @param {Boolean} [layoutParent=false] True to re-layout parent.
3205 * @return {Ext.Component} this
3207 setDocked : function(dock, layoutParent) {
3211 if (layoutParent && me.ownerCt && me.rendered) {
3212 me.ownerCt.doComponentLayout();
3217 onDestroy : function() {
3220 if (me.monitorResize && Ext.EventManager.resizeEvent) {
3221 Ext.EventManager.resizeEvent.removeListener(me.setSize, me);
3223 // Destroying the floatingItems ZIndexManager will also destroy descendant floating Components
3231 <span id='Ext-AbstractComponent-method-cleanElementRefs'> /**
3232 </span> * Remove any references to elements added via renderSelectors/childEls
3235 cleanElementRefs: function(){
3238 childEls = me.childEls,
3239 selectors = me.renderSelectors,
3246 for (len = childEls.length; i < len; ++i) {
3248 if (typeof(name) != 'string') {
3256 for (selector in selectors) {
3257 if (selectors.hasOwnProperty(selector)) {
3258 delete me[selector];
3265 delete me.frameBody;
3268 <span id='Ext-AbstractComponent-method-destroy'> /**
3269 </span> * Destroys the Component.
3271 destroy : function() {
3274 if (!me.isDestroyed) {
3275 if (me.fireEvent('beforedestroy', me) !== false) {
3276 me.destroying = true;
3280 delete me.floatParent;
3281 // A zIndexManager is stamped into a *floating* Component when it is added to a Container.
3282 // If it has no zIndexManager at render time, it is assigned to the global Ext.WindowManager instance.
3283 if (me.zIndexManager) {
3284 me.zIndexManager.unregister(me);
3286 } else if (me.ownerCt && me.ownerCt.remove) {
3287 me.ownerCt.remove(me, false);
3292 // Attempt to destroy all plugins
3293 Ext.destroy(me.plugins);
3299 me.fireEvent('destroy', me);
3300 Ext.ComponentManager.unregister(me);
3302 me.mixins.state.destroy.call(me);
3304 me.clearListeners();
3305 // make sure we clean up the element references after removing all events
3306 me.cleanElementRefs();
3307 me.destroying = false;
3308 me.isDestroyed = true;
3313 <span id='Ext-AbstractComponent-method-getPlugin'> /**
3314 </span> * Retrieves a plugin by its pluginId which has been bound to this component.
3315 * @param {Object} pluginId
3316 * @return {Ext.AbstractPlugin} plugin instance.
3318 getPlugin: function(pluginId) {
3320 plugins = this.plugins,
3321 ln = plugins.length;
3322 for (; i < ln; i++) {
3323 if (plugins[i].pluginId === pluginId) {
3329 <span id='Ext-AbstractComponent-method-isDescendantOf'> /**
3330 </span> * Determines whether this component is the descendant of a particular container.
3331 * @param {Ext.Container} container
3332 * @return {Boolean} True if it is.
3334 isDescendantOf: function(container) {
3335 return !!this.findParentBy(function(p){
3336 return p === container;
3342 prev: 'previousSibling',