PDA

View Full Version : [OPEN] Ext.getCmp - doc issue



LesJ
9 Jul 2015, 7:22 AM
The "or `null` if a Class was found." description should probably be removed because it does not return null.

Ext.getCmp('xxx') // undefined

Also, in the description of the ComponentManager.get method the word item should be replaced with component.

Ext.define('Ext.ComponentManager', {
...
},
function () {
/**
* This is shorthand reference to {@link Ext.ComponentManager#get}.
* Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id}
*
* @param {String} id The component {@link Ext.Component#id id}
* @return {Ext.Component} The Component, `undefined` if not found, or `null` if a
* Class was found.
* @member Ext
*/
Ext.getCmp = function(id) {
return Ext.ComponentManager.get(id);
};
});


******


Ext.define('Ext.ComponentManager', {
...


/**
* Returns an item by id.
* @param {String} id The id of the item
* @return {Object} The item, undefined if not found.
*/
get: function(id) {
return this.all[id];
},
...

greg.barry
9 Jul 2015, 10:59 AM
Thanks for the report! I have opened a bug in our bug tracker.