Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top