PDA

View Full Version : [SOLVED] Ext.ComponentMgr.types + Ext.each question



saprot
22 Feb 2011, 2:30 AM
Why it doesn't work? All I get in Firebug is 'undefined':



Ext.each(Ext.ComponentMgr.types, function(item, index, all) {
console.log(item.xtype);
});


But when I do:



Ext.each(Ext.ComponentMgr.types, function(item, index, all) {
console.log(item);
});


...I can see xtype property there

Stroker
22 Feb 2011, 2:36 AM
xtype have changed to alias.



Ext.each(Ext.ComponentMgr.types, function(item, index, all) {
console.log(item.alias);
});

saprot
22 Feb 2011, 2:40 AM
well, the code from first post doesn't work in 3.x either...

[BTW: could some moderator move this thread to 3.x section? Because of some forum bug my thread appeared in wrong section :)]

fabio.parra
22 Feb 2011, 4:43 AM
Why it doesn't work? All I get in Firebug is 'undefined':



Ext.each(Ext.ComponentMgr.types, function(item, index, all) {
console.log(item.xtype);
});


But when I do:



Ext.each(Ext.ComponentMgr.types, function(item, index, all) {
console.log(item);
});


...I can see xtype property there
In Ext3 Ext.ComponentMgr.types is an object. So you should use Ext.iterate instead.

saprot
22 Feb 2011, 4:57 AM
Ext.iterate works perfectly! Thanks a lot!