Ext JS: what is xtype good for?

前端 未结 5 1416
暖寄归人
暖寄归人 2021-01-31 09:07

I see there are lot\'s of examples in Ext JS where instead of actually creating Ext JS objects, an object literal with an xtype property is passed in.

What

5条回答
  •  梦如初夏
    2021-01-31 09:42

    I asked the same question as Joe, but I found the answer. If you use xtype, one approach is to also specify an itemId in the same object:

    { itemId: 'myObject', xtype: 'myClass' ... }

    Then you can find it with getComponent() as in

    this.getComponent('myObject');
    

提交回复
热议问题