1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.ComponentMgr-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.ComponentMgr-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.ComponentMgr-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="bookmark" href="../docs/?class=Ext.ComponentMgr"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8 <h1>Class Ext.ComponentMgr</h1>
9 <table cellspacing="0">
10 <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
11 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/ComponentMgr.js" target="_blank">ComponentMgr.js</a></td></tr>
12 <tr><td class="label">Class:</td><td class="hd-info">ComponentMgr</td></tr>
13 <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
15 <div class="description">
17 <p>Provides a registry of all Components (instances of <a ext:cls="Ext.Component" href="output/Ext.Component.html">Ext.Component</a> or any subclass
18 thereof) on a page so that they can be easily accessed by component id (see <a ext:cls="Ext.ComponentMgr" ext:member="get" href="output/Ext.ComponentMgr.html#get">get</a>, or
19 the convenience method <a ext:cls="Ext" ext:member="getCmp" href="output/Ext.html#getCmp">Ext.getCmp</a>).</p>
20 <p>This object also provides a registry of available Component <i>classes</i>
21 indexed by a mnemonic code known as the Component's <a ext:cls="Ext.Component" ext:member="xtype" href="output/Ext.Component.html#xtype">xtype</a>.
22 The <tt>xtype</tt> provides a way to avoid instantiating child Components
23 when creating a full, nested config object for a complete Ext page.</p>
24 <p>A child Component may be specified simply as a <i>config object</i>
25 as long as the correct xtype is specified so that if and when the Component
26 needs rendering, the correct type can be looked up for lazy instantiation.</p>
27 <p>For a list of all available xtypes, see <a ext:cls="Ext.Component" href="output/Ext.Component.html">Ext.Component</a>.</p><br><br><i>This class is a singleton and cannot be created directly.</i> </div>
29 <div class="hr"></div>
30 <a id="Ext.ComponentMgr-props"></a>
31 <h2>Public Properties</h2>
32 <table cellspacing="0" class="member-table">
34 <th class="sig-header" colspan="2">Property</th>
35 <th class="msource-header">Defined By</th>
37 <tr class="property-row expandable">
\r
38 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
40 <a id="Ext.ComponentMgr-all"></a>
\r
41 <b>all</b> : MixedCollection <div class="mdesc">
\r
42 <div class="short">The MixedCollection used internally for the component cache. An example usage may be subscribing to
43 events on the Mix...</div>
\r
45 The MixedCollection used internally for the component cache. An example usage may be subscribing to
46 events on the MixedCollection to monitor addition or removal. Read-only. </div>
\r
49 <td class="msource">ComponentMgr</td>
\r
52 <a id="Ext.ComponentMgr-methods"></a>
53 <h2>Public Methods</h2>
54 <table cellspacing="0" class="member-table">
56 <th class="sig-header" colspan="2">Method</th>
57 <th class="msource-header">Defined By</th>
59 <tr class="method-row expandable">
\r
60 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
62 <a id="Ext.ComponentMgr-create"></a>
\r
63 <b>create</b>( <code>config {Object}</code>, <code>defaultType {Constructor}</code> ) : Ext.Component <div class="mdesc">
\r
64 <div class="short">Creates a new Component from the specified config object using the
65 config object's xtype to determine the class to in...</div>
\r
67 Creates a new Component from the specified config object using the
68 config object's <a ext:cls="Ext.component" ext:member="xtype" href="output/Ext.component.html#xtype">xtype</a> to determine the class to instantiate. <div class="mdetail-params">
\r
69 <strong>Parameters:</strong>
\r
70 <ul><li><code>{Object}</code> : config<div class="sub-desc">A configuration object for the Component you wish to create.</div></li><li><code>{Constructor}</code> : defaultType<div class="sub-desc">The constructor to provide the default Component type if
71 the config object does not contain an xtype. (Optional if the config contains an xtype).</div></li> </ul>
\r
72 <strong>Returns:</strong>
\r
74 <li><code>Ext.Component</code><div class="sub-desc">The newly instantiated Component.</div></li>
\r
80 <td class="msource">ComponentMgr</td>
\r
82 <tr class="method-row alt expandable">
\r
83 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
85 <a id="Ext.ComponentMgr-get"></a>
\r
86 <b>get</b>( <code>String id</code> ) : Ext.Component <div class="mdesc">
\r
87 <div class="short">Returns a component by id</div>
\r
89 Returns a component by id <div class="mdetail-params">
\r
90 <strong>Parameters:</strong>
\r
91 <ul><li><code>id</code> : String<div class="sub-desc">The component id</div></li> </ul>
\r
92 <strong>Returns:</strong>
\r
94 <li><code>Ext.Component</code></li>
\r
100 <td class="msource">ComponentMgr</td>
\r
102 <tr class="method-row expandable">
\r
103 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
105 <a id="Ext.ComponentMgr-onAvailable"></a>
\r
106 <b>onAvailable</b>( <code>String id</code>, <code>Function fn</code>, <code>Object scope</code> ) : void <div class="mdesc">
\r
107 <div class="short">Registers a function that will be called when a specified component is added to ComponentMgr</div>
\r
109 Registers a function that will be called when a specified component is added to ComponentMgr <div class="mdetail-params">
\r
110 <strong>Parameters:</strong>
\r
111 <ul><li><code>id</code> : String<div class="sub-desc">The component id</div></li><li><code>fn</code> : Function<div class="sub-desc">The callback function</div></li><li><code>scope</code> : Object<div class="sub-desc">The scope of the callback</div></li> </ul>
\r
112 <strong>Returns:</strong>
\r
114 <li><code>void</code></li>
\r
120 <td class="msource">ComponentMgr</td>
\r
122 <tr class="method-row alt expandable">
\r
123 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
125 <a id="Ext.ComponentMgr-register"></a>
\r
126 <b>register</b>( <code>Ext.Component c</code> ) : void <div class="mdesc">
\r
127 <div class="short">Registers a component.</div>
\r
129 Registers a component. <div class="mdetail-params">
\r
130 <strong>Parameters:</strong>
\r
131 <ul><li><code>c</code> : Ext.Component<div class="sub-desc">The component</div></li> </ul>
\r
132 <strong>Returns:</strong>
\r
134 <li><code>void</code></li>
\r
140 <td class="msource">ComponentMgr</td>
\r
142 <tr class="method-row expandable">
\r
143 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
145 <a id="Ext.ComponentMgr-registerType"></a>
\r
146 <b>registerType</b>( <code>String xtype</code>, <code>Constructor cls</code> ) : void <div class="mdesc">
\r
147 <div class="short">Registers a new Component constructor, keyed by a new
149 Use this method to register new subclasses...</div>
\r
151 <p>Registers a new Component constructor, keyed by a new
152 <a ext:cls="Ext.Component" ext:member="xtype" href="output/Ext.Component.html#xtype">Ext.Component.xtype</a>.</p>
153 <p>Use this method to register new subclasses of <a ext:cls="Ext.Component" href="output/Ext.Component.html">Ext.Component</a> so
154 that lazy instantiation may be used when specifying child Components.
155 see <a ext:cls="Ext.Container" ext:member="items" href="output/Ext.Container.html#items">Ext.Container.items</a></p> <div class="mdetail-params">
\r
156 <strong>Parameters:</strong>
\r
157 <ul><li><code>xtype</code> : String<div class="sub-desc">The mnemonic string by which the Component class
158 may be looked up.</div></li><li><code>cls</code> : Constructor<div class="sub-desc">The new Component class.</div></li> </ul>
\r
159 <strong>Returns:</strong>
\r
161 <li><code>void</code></li>
\r
167 <td class="msource">ComponentMgr</td>
\r
169 <tr class="method-row alt expandable">
\r
170 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
172 <a id="Ext.ComponentMgr-unregister"></a>
\r
173 <b>unregister</b>( <code>Ext.Component c</code> ) : void <div class="mdesc">
\r
174 <div class="short">Unregisters a component.</div>
\r
176 Unregisters a component. <div class="mdetail-params">
\r
177 <strong>Parameters:</strong>
\r
178 <ul><li><code>c</code> : Ext.Component<div class="sub-desc">The component</div></li> </ul>
\r
179 <strong>Returns:</strong>
\r
181 <li><code>void</code></li>
\r
187 <td class="msource">ComponentMgr</td>
\r
190 <a id="Ext.ComponentMgr-events"></a>
191 <h2>Public Events</h2>
192 <div class="no-members">This class has no public events.</div>