Phạm Quốc Bảo
Phạm Quốc Bảo

Reputation: 894

In the tabpanel of ExtJS 4, how to create parent tab includes 2 child tab

I have 2 parent tabs, each tab includes 2 child tab. pls see the picture for more detail: enter image description here

How to create the group tab for the parent tab and when the author click the parent tab, the child tab will be shown. Thanks

Upvotes: 1

Views: 182

Answers (1)

Benoit Cuvelier
Benoit Cuvelier

Reputation: 776

Ext.widget('tabpanel', {
    width: 500,
    activeTab: 0,
    items: [{
        title: 'Parent Tab 1',
        items : [
            Ext.widget('tabpanel', {
                activeTab: 0,
                 items : [{
                    title: 'Child Tab 1',
                    bodyPadding: 10,
                    html : "My content of Child Tab 1 here"
                },{
                    title: 'Child Tab 2',
                    bodyPadding: 10,
                    html : "My content of Child Tab 2 here"
                }]
            })
        ]
    },{
        title: 'Parent Tab 2',
        bodyPadding: 10,
        html : "Parent Tab 2 content here without child tabs"
    }]
});

Here is a fiddle with an example of Parent tab containg child tabs :

http://jsfiddle.net/Q7f5q/200/

Hope it is what you looking for.

Upvotes: 1

Related Questions