大家好,在这里发布我的问题后。代码是
Ext.define('MyPrj.view.Main', {
extend: 'Ext.Container',
alias: 'widget.mainmenuview',
config: {
activeItem: 1,
width: 710,
margin: '10px auto 0',
layout: {
type: 'hbox'
},
items: [
{
flex: 1,
xtype:'menupage',
cls: 'menuPage',
},
{
flex:2,
xtype:'homepage',
cls: 'homePage',
},
{
flex:1,
xtype:'categorypage',
cls: 'categoryPage',
},
]
}
});
在菜单上的 itemTap 之后,我得到了这个结果![结果][3]
itemTap的代码
if(id == '1'){
console.log("Value of Click--"+id);
var publishedword = { xtype: 'publishedword' };
// I am assuming active item is container, here i am getting Container object
var outerContainer = Ext.Viewport.getActiveItem(1);
// removing the second item (index start with 0)
outerContainer.down('panel').removeAt(1);
// replacing second item into publishedword
outerContainer.down('panel').insert(1, publishedword);
outerContainer.getAt(1).setActiveItem(publishedword);
}
我的结果应该是:
![预期结果][4] 感谢您的帮助。