Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / examples / tabs / tabs-adv.js
1 /*!
2  * Ext JS Library 3.0.3
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Ext.onReady(function(){
8
9     var tabs = new Ext.TabPanel({
10         renderTo:'tabs',
11         resizeTabs:true, // turn on tab resizing
12         minTabWidth: 115,
13         tabWidth:135,
14         enableTabScroll:true,
15         width:600,
16         height:250,
17         defaults: {autoScroll:true},
18         plugins: new Ext.ux.TabCloseMenu()
19     });
20
21     // tab generation code
22     var index = 0;
23     while(index < 7){
24         addTab();
25     }
26     function addTab(){
27         tabs.add({
28             title: 'New Tab ' + (++index),
29             iconCls: 'tabs',
30             html: 'Tab Body ' + (index) + '<br/><br/>'
31                     + Ext.example.bogusMarkup,
32             closable:true
33         }).show();
34     }
35
36     new Ext.Button({
37         text: 'Add Tab',
38         handler: addTab,
39         iconCls:'new-tab'
40     }).render(document.body, 'tabs');
41 });