Reputation: 404
I am using Ext.getCmp for finding one extjs component in tab panel. some times it is not working an returning undefined.
var currComp = Ext.getCmp('myId'); //Id is generated by me on creation
Is any other method exists? to find one Component if i know its id?
Upvotes: 3
Views: 13371
Reputation: 1897
If you know the parent control then getComponent method can be used.
getComponent - Examines this container's items property and gets a direct child component of this container.
var compont = parentControl.getComponent('yourId');
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.AbstractContainer-method-getComponent
Try to set the itemId also when creating.
Upvotes: 5