Question

Consider:

Ext.Array.each(myContainer.query('> *'), function(cmp) { cmp.hide(); });

Is there a better way?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top