任何可以告诉我为什么我不断收到一个方法buildItems未在以下代码中定义?我逃避一些重要的东西吗?Extjs通过定义延伸时未定义的方法
Ext.define('MyApp.view.Viewport', {
extend: 'Ext.container.Viewport',
requires: [
'Ext.layout.container.Border'
],
layout : 'border',
items : [this.buildItems()],
buildItems : function() {
return { region:'center',xtype:'panel'}
}
});
的buildItems方法没有理由成为一个公共的方法,我只是先尝试这种方式。这是我现在这样做的方式:
(function() {
function buildItems() {
return [
{
region : 'center',
xtype : 'panel',
}, {
region : 'west',
xtype : 'panel',
width : 225
},{
region : 'south',
xtype : 'panel',
height : 50
},{
region : 'north',
xtype : 'panel',
height : 50
}
]
}
return Ext.define('MyApp.view.Viewport', {
extend: 'Ext.container.Viewport',
requires: [
'Ext.layout.container.Border'
],
layout : 'border',
items : buildItems()
});
})();
这是一个过度延伸?
THX
我在我的问题中增加了另一部分,这是隐藏buildItem的又一个好方法,也就是说它是私人的,因为它没有定义public – ken 2011-04-30 08:08:03