4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 * @class Roo.ComponentMgr
15 * Provides a common registry of all components on a page so that they can be easily accessed by component id (see {@link Roo.getCmp}).
18 Roo.ComponentMgr = function(){
19 var all = new Roo.util.MixedCollection();
23 * Registers a component.
24 * @param {Roo.Component} c The component
26 register : function(c){
31 * Unregisters a component.
32 * @param {Roo.Component} c The component
34 unregister : function(c){
39 * Returns a component by id
40 * @param {String} id The component id
47 * Registers a function that will be called when a specified component is added to ComponentMgr
48 * @param {String} id The component id
49 * @param {Funtction} fn The callback function
50 * @param {Object} scope The scope of the callback
52 onAvailable : function(id, fn, scope){
53 all.on("add", function(index, o){
55 fn.call(scope || o, o);
56 all.un("add", fn, scope);