问题描述
|
如何通过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();
它不起作用,因为经理不存在
我需要在变量中初始化组件以执行此操作吗?
对于商店,它的工作方式如下:
Ext.regStore(\'newsstore\',{
...
});
检索依据:
Ext.StoreMgr.get(\'newsstore\').read();
解决方法
将组件注册到Ext时,会将其注册为xtype。
您需要做的是
var newsSearchSection = myPanel.add({xtype:\'newsSearchSection\'})
myPanel.setActiveItem(newsSearchSection)