PDA

View Full Version : Adding new tabs to tab panel dynamically



wasima
15 Jul 2013, 8:00 AM
Hi ,
I have a tab panel , i want to add new tabs to tab panel dynamically . I tried like this


Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
xtype: 'tabpanel',
html:'<div id="connectivity" style="width: 100%; height: 100%"></div>',
title: 'Tab Panel'
}
]
});



var tabs = new Array();
var tab1 = {
title:' Tab 1',
itemId :1,
layout :'fit'
};
var tab2 = {
title:' Tab 2',
itemId :2,
layout :'fit'
};

tabs.push(tab1);
tabs.push(tab2);
Ext.apply(Ext.get('connectivity'),{items :tabs});




But it didn't work .Please help me .

evant
15 Jul 2013, 10:48 PM
There's an example of exactly this in the SDK download: /examples/tabs/tabs-adv.html

cdt
7 Jan 2014, 4:46 PM
Hi evant, couldn't find your example in touch-2.3.1. Is this still available?