Ext.getCmp(id) or Ext.ComponentQuery.query(attribute)

The best is to avoid using any of this two directly. Ext.getCmp is especially considered bad “code smell”. You should strive to organize your code in such a way that you don’t need them.

Component queries are elegant, but you should use them either from a parent container (thus reducing the research tree and allowing you to leverage relative itemId), or from a controller. It is my guess that controllers are the true reason why component queries have been added to Ext4.

Leave a Comment