访问Ext.ComponentMgr中的组件对象

  Ext.Component是所有Ext组件的基类,所有组件被注册在布局管理器中Ext.ComponentManager, 这样就可以通过Ext.getCmp随时被引用,每种组件都有特定的类型,是Ext自身设置的类型。 对xtype检查的相关方法有getXType、isXType。

Ext.ComponentMgr.all.each(function (cmp) {
    var xtype = cmp.getXType();
    if (xtype == "gridpanel") {
        //do sth
    }
});
原文地址:https://www.cnblogs.com/wuln/p/6225099.html