Sencha touch Sencha touch:如何通过Ext.reg()检索/获取元素寄存器

Sencha touch Sencha touch:如何通过Ext.reg()检索/获取元素寄存器,sencha-touch,extjs,Sencha Touch,Extjs,如何通过Ext.reg方法检索元素寄存器 prj.views.NewsSearchSection = Ext.extend(Ext.Panel, { fullscreen: true, modal: true, floating: true, layout: 'fit', scroll: 'vertical', initComponent: function() { this.listpanel = new Ext.Panel(

如何通过Ext.reg方法检索元素寄存器

prj.views.NewsSearchSection = Ext.extend(Ext.Panel, {
    fullscreen: true,
    modal: true,
    floating: true,
    layout: 'fit',
    scroll: 'vertical',

    initComponent: function() {

        this.listpanel = new Ext.Panel({
            ...
        })

        this.items = this.listpanel;

        prj.views.NewsSearchSection.superclass.initComponent.call(this);
    },

});

Ext.reg('newsSearchSection', prj.views.NewsSearchSection);
我想用show()方法像弹出窗口一样显示/显示面板。 我该怎么做?

我试过了

Ext.Mgr.get('newsSearchSection').show();
它不起作用,因为Mgr不存在

我需要在一个变量中初始化这个组件才能做到这一点

对于store,其工作原理如下:

Ext.regStore('newsStore',  {
    ...       
});
检索方式:

Ext.StoreMgr.get('newsStore').read();

将组件注册到Ext时,将其注册为xtype

你需要做的是

var newsSearchSection = myPanel.add({xtype:'newsSearchSection'})
myPanel.setActiveItem(newsSearchSection)

面板的布局必须是卡片布局吗?是的,根据API文档