extjs - How can I replace the content of a panel with new content? -


i have regioncontent panel add viewport.

how can replace content new content?

    ...     var regioncontent = new ext.panel({         id: 'contentarea',         region: 'center',         padding:'10',         autoscroll: true,         html: 'this original content'     });      var viewport = new ext.viewport({         layout: 'border',         items: [ regionmenu, regioncontent ]     });      var newpanel = new ext.panel({         region: 'east',         title: 'info panel',         width: 300,         html: 'this panel added'     });     // regioncontent.update(newpanel); //renders javascript code ???     // regioncontent.remove(...) //how remove content, not know in panel remove     regioncontent.add(newpanel); //adds original content not replace     regioncontent.dolayout();     ... 

.update() this:

alt text

.add() this:

alt text

you'll want use panel card layout:

var card=new ext.panel({     layout:'card',     activeitem:0,     items:[ regioncontent , newpanel ] }); 

that panel can go inside viewport. switch between them you'll use this:

card.getlayout().setactiveitem(1); 

take @ 2 card layouts working examples: http://dev.extjs.com/deploy/dev/examples/layout-browser/layout-browser.html


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -