PDA

View Full Version : getXType returns unexpected (for me) value



johnleroux
29 Jun 2009, 12:42 AM
Using the code below p.getXType() always returns the last type I registered instead of the xtype (test1) I used to create it. Should it not return 'test1' as the xtype?


testPanel = Ext.extend(Ext.Panel, {});

Ext.reg('test1', testPanel);
Ext.reg('test2', testPanel);
Ext.reg('test3', testPanel);

var p = Ext.ComponentMgr.create({xtype: 'test1'});

alert(p.getXType());

Animal
29 Jun 2009, 3:17 AM
A single class maps to one xtype.

Whichever xtype you tell it to map to.

So in your case, you map your new Panel class to "test3"

johnleroux
29 Jun 2009, 3:22 AM
Dankie.