Properties Methods Events Direct Link

# Class Ext.ComponentMgr

Package: | Ext
Defined In: | ComponentMgr.js
Class: | ComponentMgr
Extends: | Object

Provides a registry of all Components (specifically subclasses of Ext.Component) on a page so that they can be easily accessed by component id (see Ext.getCmp).

This object also provides a registry of available Component classes indexed by a mnemonic code known as the Component's Ext.Component.xtype. The `xtype` provides a way to avoid instantiating child Components when creating a full, nested config object for a complete Ext page.

A child Component may be specified simply as a config object as long as the correct xtype is specified so that if and when the Component needs rendering, the correct type can be looked up for lazy instantiation.

For a list of all available xtypes, see Ext.Component.

This class is a singleton and cannot be created directly.

## Public Properties

Property | Defined By
--- | ---
| all : MixedCollection The MixedCollection used internally for the component cache. An example usage may be subscribing to events on the Mix... The MixedCollection used internally for the component cache. An example usage may be subscribing to events on the MixedCollection to monitor addition or removal. Read-only. | ComponentMgr

## Public Methods

Method | Defined By
--- | ---

get( `String id` ) : Ext.Component
Returns a component by id
Returns a component by id
Parameters:

- `id` : String
  The component id

Returns:

- `Ext.Component`

ComponentMgr

onAvailable( `String id`, `Function fn`, `Object scope` ) : void
Registers a function that will be called when a specified component is added to ComponentMgr
Registers a function that will be called when a specified component is added to ComponentMgr
Parameters:

- `id` : String
  The component id
- `fn` : Function
  The callback function
- `scope` : Object
  The scope of the callback

Returns:

- `void`

ComponentMgr

register( `Ext.Component c` ) : void
Registers a component.
Registers a component.
Parameters:

- `c` : Ext.Component
  The component

Returns:

- `void`

ComponentMgr

registerType( `String xtype`, `Constructor cls` ) : void
Registers a new Component constructor, keyed by a new Ext.Component.xtype. Use this method to register new subclasses...
Registers a new Component constructor, keyed by a new Ext.Component.xtype.
Use this method to register new subclasses of Ext.Component so that lazy instantiation may be used when specifying child Components. see Ext.Container.items
Parameters:

- `xtype` : String
  The mnemonic string by which the Component class may be looked up.
- `cls` : Constructor
  The new Component class.

Returns:

- `void`

ComponentMgr

unregister( `Ext.Component c` ) : void
Unregisters a component.
Unregisters a component.
Parameters:

- `c` : Ext.Component
  The component

Returns:

- `void`

ComponentMgr

## Public Events

This class has no public events.