旧视图出现在背景中 [英] Old View appears in Background

查看:99
本文介绍了旧视图出现在背景中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,此处.的代码是

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]

After itemTap on Menu i get this result![result][3]

itemTap的代码

Code of 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] 谢谢您的帮助.

![result expected][4] Thank You for Help.

推荐答案

我使用

removeInnerAt(index);

中所述通过@TDeBailleul 我将其用作:

as said in by @TDeBailleul I used it as:

panel.removeInnerAt(0);
var publishedword = { xtype: 'publishedword' }; 
panel.insert(0, publishedword);

希望它可能对您有所帮助.

Hope it may help some one.

这篇关于旧视图出现在背景中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆