Extjs4 加载时Extjs 4 portlet崩溃,无法正常工作

Extjs4 加载时Extjs 4 portlet崩溃,无法正常工作,extjs4,Extjs4,我正在应用程序中使用ExtJS门户代码 我希望在加载页面时使portlet处于折叠状态。所以我做了一些类似的事情 items: [{ id: 'portlet-1', title: 'Grid Portlet Texsds', tools: this.getTools(),

我正在应用程序中使用ExtJS门户代码

我希望在加载页面时使portlet处于折叠状态。所以我做了一些类似的事情

items: [{
                            id: 'portlet-1',
                            title: 'Grid Portlet Texsds',
                            tools: this.getTools(),
                            height:200,
                            **collapsed:true,**
                            autoScroll :true,
                            items: Ext.create('Ext.app.GridPortlet'),
                            listeners: {
                                'close': Ext.bind(this.onPortletClose, this),
                                'endDrag': Ext.bind(this.onPortletDrag, this),
                                'resize' :Ext.bind(this.onPortletResize, this)
                            }
                        }
我已使倒塌的财产成为现实。但是由于这个原因,当我尝试在页面加载后扩展portlet时,我可以看到blank Grid.Plz。请参阅所附图片

有什么问题?我需要刷新一下吗?因为当我将“折叠”设置为false时,我可以看到网格

请建议这里缺少什么

这是getTools:function()的代码{

第一次,当Portlet被加载时,它处于崩溃状态,现在当我点击交叉图标[D]来扩展图标时,我可以看到空白网格。


希望这次我能解释清楚。

我使用Ext JS 4示例门户应用程序,将您的代码(不带星号)添加到portlet-1中。它在加载时正确折叠并展开以显示网格

我认为您发布的代码没有任何问题,可能您更改了周围容器的布局或布局属性,这会影响您的portlet

这是我完整的portal.js:

Ext.define('Ext.app.Portal'{
扩展:“Ext.container.Viewport”,
//需要:['Ext.diag.layout.ContextItem','Ext.diag.layout.Context'],
用法:['Ext.app.PortalPanel','Ext.app.PortalColumn','Ext.app.GridPortlet','Ext.app.ChartPortlet'],
getTools:function(){
返回[{
xtype:'工具',
类型:'齿轮',
处理程序:函数(e、目标、panelHeader、工具){
var portlet=panelHeader.ownerCt;
setLoading('Loading…');
Ext.defer(函数(){
setLoading(false);
}, 2000);
}
}];
},
initComponent:function(){
var content=''+Ext.example.shortBogusMarkup+'';
Ext.apply(本{
id:“应用程序视口”,
布局:{
键入:“边框”,
填充:“0 5”//从窗口边缘填充布局
},
项目:[{
id:'应用程序标题',
xtype:'框',
地区:'北',
身高:40,
html:“外部门户”
},{
xtype:'容器',
地区:'中心',
布局:“边框”,
项目:[{
id:“应用程序选项”,
标题:“选项”,
地区:'西部',
对,,
宽度:200,
最小宽度:150,
最大宽度:400,
斯普利特:是的,
可折叠的:是的,
布局:{
类型:“手风琴”,
动画:真实
},
项目:[{
html:内容,
标题:"导航",,
autoScroll:是的,
边界:错,
iconCls:“导航”
},{
标题:“设置”,
html:内容,
边界:错,
autoScroll:是的,
iconCls:“设置”
}]
},{
id:“应用程序门户”,
xtype:'portalpanel',
地区:'中心',
项目:[{
id:'col-1',
项目:[{
id:'portlet-1',
标题:“网格Portlet”,
工具:this.getTools(),
对,,
身高:200,
autoscroll:是的,
项目:Ext.create('Ext.app.GridPortlet'),
听众:{
“关闭”:Ext.bind(this.onPortletClose,this)
}
},{
id:'portlet-2',
标题:“Portlet 2”,
工具:this.getTools(),
html:内容,
听众:{
“关闭”:Ext.bind(this.onPortletClose,this)
}
}]
},{
id:'col-2',
项目:[{
id:'portlet-3',
标题:“Portlet 3”,
工具:this.getTools(),
html:''+Ext.example.bogusMarkup+'',
听众:{
“关闭”:Ext.bind(this.onPortletClose,this)
}
}]
},{
id:'col-3',
项目:[{
id:'portlet-4',
标题:“股票Portlet”,
工具:this.getTools(),
项目:Ext.create('Ext.app.ChartPortlet'),
听众:{
“关闭”:Ext.bind(this.onPortletClose,this)
}
}]
}]
}]
}]
});
this.callParent(参数);
},
onPortletClose:函数(portlet){
this.showMsg(“'+portlet.title+'”已被删除);
},
showMsg:函数(msg){
var el=Ext.get('app-msg'),
msgId=Ext.id();
this.msgId=msgId;
el.update(msg.show();
Ext.defer(this.clearMsg,3000,this[msgId]);
},
{
            type: 'Minimize',
            handler: function(e,target,panelHeader,tool){
                //panelHeader.ownerCt.toggleCollapse();
                if (panelHeader.ownerCt.collapsed)
                {
                    panelHeader.ownerCt.expand();

                }
                else {
                    panelHeader.ownerCt.collapse();
                }
            }
        }