This question already has an answer here:
- ExtJS. Hide all components within a container 3 answers
Consider:
Ext.Array.each(myContainer.query('> *'), function(cmp) { cmp.hide(); });
Is there a better way?
This question already has an answer here:
Consider:
Ext.Array.each(myContainer.query('> *'), function(cmp) { cmp.hide(); });
Is there a better way?
Your approach uses a query which takes more resources. A more efficient way may be just:
Ext.each(myContainer.items.items, function(cmp) { cmp.hide(); });
Since you already have a reference to myContainer, there's no point of querying for its children as you already have access to them.
If you want it even more efficient, you can also write your own for loop and iterate across myContainer.items.items.