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

    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
    698
    Vote Rating
    27
    carol.ext will become famous soon enough carol.ext will become famous soon enough

      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,508
    Vote Rating
    57
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      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