访问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
    }
});

 

posted @ 2016-12-27 11:00  wuln  阅读(125)  评论(0)    收藏  举报