PDA

View Full Version : TabPanel's Content Displaying 2 times One By One



funnyfox
5 Feb 2013, 8:47 AM
I have a TabPanel with 2 tabs, this Tab Panel is invoked from 2 different screens.
From First screen - We are disabling one tab and showing another one


this.invDetailPanel.invTabDetailPanel.getComponent('inv-2-tab').disable();
this.getLayout().setActiveItem(4);

The 4th Item here is....


{
xtype: 'panel',
border:false,
layout:'anchor',
items: [
me.invDetailPanel,
{
border : false,
anchor:'100% 5%'
}
]
}


From Second Screen - We are Setting this item to active.


this.getLayout().setActiveItem(1);
this.invDetailPanel.loadInvDetail(invoiceId);


The 1st Item here is ...

{
xtype: 'panel',
border:false,
autoScroll:true,
layout:'anchor',
items: [
me.invDetailPanel,
{
border : false,
anchor:'100% 5%'
}
]
}


The problem here is , after accessing invDetailPanel from second screen and again accessing it from first screen and again come back and access from second screen, The TabPanel's first tab is shown twice one after the other, we are not sure about the problem. The TabPanel has a Grid and FieldSet, these 2 items are shown 2 times one by one inside first Tab as follows.
The second Tab is fine

Inv-1-Tab
InvGrid
FieldSet
InvGrid
FieldSet


Any Help is appreciated.

TabPanel Code inside InvDetail Panel is......



me.invTabDetailPanel = Ext.create('Ext.tab.Panel', {
plain: true,
border:false,
items : [ {
title : 'First-Tab',
id: 'inv-1-tab',
bodyPadding: 10,
items : [me.InvGridPanel,{
xtype: 'container',
height: 20
},{
xtype:'fieldset',
title : 'Summary',
collapsible: true,
layout: 'column',
items :[{
xtype: 'container',
columnWidth:.5,
items:[{
xtype : 'component',
html : '<br/>'
}]
},{
xtype:'displayfield',
fieldLabel: 'Total Amount',
name: 'invoiceAmount',
renderer : Ext.util.Format.usMoney,
labelWidth: 150
}]
}]
}]
}, {
title : 'Second-Tab',
id: 'inv-2-tab',
bodyPadding: 10,
items : [me.invRGridPanel,{
xtype: 'container',
height: 20
},{
xtype:'fieldset',
title : 'Some Summary',
collapsible: true,
layout: 'column',
items :[{
xtype: 'container',
columnWidth:.5,
items:[{
xtype : 'component',
html : '<br/>'
}]
},{
xtype:'displayfield',
fieldLabel: 'Balance',
name: 'BalAmount',
renderer : Ext.util.Format.usMoney,
labelWidth: 150
}]
}]
}]
}]
});

mitchellsimoens
7 Feb 2013, 8:13 AM
I don't see anything that you are adding new components so from what you have provided I don't see a reason.

sriram139
7 Feb 2013, 12:23 PM
You may want to try using itemId instead of 'id'.

Thanks,
Sriram

funnyfox
11 Feb 2013, 9:35 AM
Thats Correct. Thanks