PDA

View Full Version : Updating Panel Content



joevelardi
19 Jul 2010, 3:55 PM
Hi,

I have a West Panel with content, plus i have tabs within the Center Panel.

When i click a tab within the Center Panel, i would like to change the content of the West Panel.

How do i replace the contents of westNav to westSupport when i click on the Support tab ?


I've snipped some code so apologies if code is not syntactically correct .. just looking for come code and concept. cheers.

var westNav = new Ext.Panel({
id: 'west-nav',
title: 'Navigation',
layout: 'fit',
anchor: '100% 100%',
html: 'blah'
});

var westSupport = new Ext.Panel({
id: 'west-support',
title: 'Support',
layout: 'fit',
anchor: '100% 100%',
html: 'more blah'
});

Ext.onReady(function() {

var viewport = new Ext.Viewport({
layout: 'border',
renderTo: Ext.getBody(),
items: [
{ region: 'west',
id: 'west-panel',
title: 'Navigation',
layout: 'anchor',
items: [westNav]
}, {

region: 'center',
id: 'center-panel',
xtype: 'tabpanel', activeTab: 0,
items: [

{ title: 'Home',
id: 'center-home',
xtype: 'tabpanel',
items: [{ ... }]
},
{ title: 'Support',
xtype: 'tabpanel',
activeTab: 0,
items: [{ ... }] }]
});
});