major doc changes
[roojs1] / Roo / bootstrap / dash / TabPane.js
1 /*
2  * - LGPL
3  *
4  * Tab pane
5  * 
6  */
7 Roo.bootstrap.dash = Roo.bootstrap.dash || {};
8 /**
9  * @class Roo.bootstrap.TabPane
10  * @extends Roo.bootstrap.Component
11  * @children  Roo.bootstrap.Graph Roo.bootstrap.Column
12  * Bootstrap TabPane class
13  * @cfg {Boolean} active (false | true) Default false
14  * @cfg {String} title title of panel
15
16  * 
17  * @constructor
18  * Create a new TabPane
19  * @param {Object} config The config object
20  */
21
22 Roo.bootstrap.dash.TabPane = function(config){
23     Roo.bootstrap.dash.TabPane.superclass.constructor.call(this, config);
24     
25     this.addEvents({
26         // raw events
27         /**
28          * @event activate
29          * When a pane is activated
30          * @param {Roo.bootstrap.dash.TabPane} pane
31          */
32         "activate" : true
33          
34     });
35 };
36
37 Roo.extend(Roo.bootstrap.dash.TabPane, Roo.bootstrap.Component,  {
38     
39     active : false,
40     title : '',
41     
42     // the tabBox that this is attached to.
43     tab : false,
44      
45     getAutoCreate : function() 
46     {
47         var cfg = {
48             tag: 'div',
49             cls: 'tab-pane'
50         };
51         
52         if(this.active){
53             cfg.cls += ' active';
54         }
55         
56         return cfg;
57     },
58     initEvents  : function()
59     {
60         //Roo.log('trigger add pane handler');
61         this.parent().fireEvent('addpane', this)
62     },
63     
64      /**
65      * Updates the tab title 
66      * @param {String} html to set the title to.
67      */
68     setTitle: function(str)
69     {
70         if (!this.tab) {
71             return;
72         }
73         this.title = str;
74         this.tab.select('a', true).first().dom.innerHTML = str;
75         
76     }
77     
78     
79     
80 });
81
82  
83
84
85