1. #1
    Sencha User
    Join Date
    Apr 2008
    Location
    Brazil
    Posts
    57
    Vote Rating
    0
    cesarwbr is on a distinguished road

      0  

    Default TabPanel and Panel

    Hi,
    What's the better way to put a TabPanel in a tab of TabPanel?
    I'm doing it:

    html page:
    Code:
    <div id="myTab"></div>
    js:
    Code:
    var myTab = new Ext.TabPanel({ 
                                renderTo: 'myTab',
                                items:[{ 
                                    title: 'A Tab', 
                                    html: 'TAB' 
                                }]
                           });
    
    new Ext.TabPanel({ 
                                items:[{ 
                                    contentEl: 'myTab'
                                }]
                         });
    There is a better way to do it?

  2. #2
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    708
    Vote Rating
    35
    carol.ext has a spectacular aura about carol.ext has a spectacular aura about

      0  

    Default

    Include myTab as an item on the second TabPanel. rather than using contentEl. Then you would need to use renderTo on the second TabPanel rather than first (or better yet put it in a viewport instead... but I don't really know what you are trying to do).

    I have better luck when I include a title for all tabs in tabpanel and specify the activeTab for all TabPanels.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,569
    Vote Rating
    55
    Animal will become famous soon enough Animal will become famous soon enough

      0  

    Default

    Have no HTML in your page at all.

    Do not use contentEl.

    To put ANY BoxComponent (See inheritance chart at the top of every API doc page) into a TabPanel, just use it as an item

Thread Participants: 2