layout - Old View appears in Background -


hi after posting problem here. code

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',   },   ]     } }); 

after itemtap on menu result![result][3]

code of itemtap

if(id == '1'){ console.log("value of click--"+id); var publishedword = { xtype: 'publishedword' };      // assuming active item container, here getting container object    var outercontainer = ext.viewport.getactiveitem(1);     // removing second item (index start 0)     outercontainer.down('panel').removeat(1);     // replacing second item publishedword    outercontainer.down('panel').insert(1, publishedword);    outercontainer.getat(1).setactiveitem(publishedword);  } 

my result supposed be:

![result expected][4] thank help.

first of - why using container mainmenuview instead of tabpanel?

now code:

   var outercontainer = ext.viewport.getactiveitem(1); 

getactiveitem() not support index. activeitem should mainmenuview

   outercontainer.down('panel').removeat(1); 

if menupage, homepage, ... panels inside panel remove second item (remember removing item before add item)

   outercontainer.down('panel').insert(1, publishedword); 

now inserting published word

   outercontainer.getat(1).setactiveitem(publishedword); 

and here setting active item not panel, removed , added items, first item inside outercontainer, not neccessarily trying address.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -