Results 1 to 4 of 4

Thread: TabPanel's Content Displaying 2 times One By One

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    India
    Posts
    30
    Answers
    2
    Vote Rating
    0
      0  

    Default Answered: TabPanel's Content Displaying 2 times One By One

    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

    Code:
    this.invDetailPanel.invTabDetailPanel.getComponent('inv-2-tab').disable();                
    this.getLayout().setActiveItem(4);
    The 4th Item here is....

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

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

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

    The 1st Item here is ...
    Code:
    {
                    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......


    Code:
    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
                                }]
                            }]
                        }]
                }]
            });

  2. You may want to try using itemId instead of 'id'.

    Thanks,
    Sriram

  3. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    I don't see anything that you are adding new components so from what you have provided I don't see a reason.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  4. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    44
    Answers
    6
    Vote Rating
    2
      0  

    Default

    You may want to try using itemId instead of 'id'.

    Thanks,
    Sriram

  5. #4
    Sencha User
    Join Date
    Mar 2012
    Location
    India
    Posts
    30
    Answers
    2
    Vote Rating
    0
      0  

    Default

    Thats Correct. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •