Pregunta

Consider:

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

Is there a better way?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top