大家好张贴我的问题后这里 。 此代码是
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]感谢您的帮助。