0
votes

I am new to extjs. I want to create tabs in my panel, based on a number generated from dataBase (consider the value is stored in 'numOfTabs' which is fetched from dataBase and available in JS).

I don't want to use any button event to generate tabs, but on page load itself I need to view tabs.

How can I create 'n' tabs in my panel, where 'n' is the value in numOfTabs ?

Using extjs4.2.2

2

2 Answers

1
votes
var tabPanel = Ext.getCmp('tabsID');
var items = tabPanel.items.items;
tabPanel.add({
    title: tTitle,
    id: tChieldID,
    closable: true,
    layout: 'fit',
    flex: 1,
    items: [{...}]
});
tabPanel.setActiveTab(tChieldID);