3

Suppose I have an component's instance but I don't know what it is. Is there a convenient way to get the xtype of this component?

Grant Zhu
  • 2,988
  • 2
  • 23
  • 28

1 Answers1

12

According to the API all components (all types of Ext JS objects with an xtype I guess) inherits a method getXType(), which you can use like in the following:

var t = new Ext.form.TextField();
alert(t.getXType());  // alerts 'textfield'
Chau
  • 5,540
  • 9
  • 65
  • 95