Results 1 to 3 of 3

Thread: Add / Remove Tab Pages to a Tab Panel on the fly?

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    149
    Answers
    5
    Vote Rating
    7
      0  

    Default Answered: Add / Remove Tab Pages to a Tab Panel on the fly?

    How do I Add or Remove Tab Pages to a Tab Panel at run-time?
    I tried:
    Code:
                              
     var tp = bNimble.tabpanel;
    var ct = tp.items.items.length;
    var tpg = tp.add({
        title: 'Contact ' + ct,
        iconCls: 'user ' + ct,
        html: 'Contact Screen ' + ct
    });
    The items count went up, but the new tab page icon does not show up on the tab bar.
    Adding tpg.show(); did not help.
    Thanks
    David

  2. This shows the new tab:

    Code:
    var tabpanel = new Ext.tab.Panel({
        fullscreen : true,
        items      : [
            {
                title : 'One',
                html  : 'one'
            },
            {
                title : 'Two',
                html  : 'two'
            }
        ]
    });
    
    tabpanel.add({
        title : 'Three',
        html  : 'three'
    });

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    This shows the new tab:

    Code:
    var tabpanel = new Ext.tab.Panel({
        fullscreen : true,
        items      : [
            {
                title : 'One',
                html  : 'one'
            },
            {
                title : 'Two',
                html  : 'two'
            }
        ]
    });
    
    tabpanel.add({
        title : 'Three',
        html  : 'three'
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Boston
    Posts
    149
    Answers
    5
    Vote Rating
    7
      0  

    Default

    You are right. I must have had some other error in my code.
    Thanks
    David

Tags for this Thread

Posting Permissions

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