9 * @class Roo.bootstrap.TabPanel
10 * @extends Roo.bootstrap.Component
11 * Bootstrap TabPanel class
12 * @cfg {Boolean} active panel active
13 * @cfg {String} html panel content
14 * @cfg {String} tabId tab relate id
15 * @cfg {String} navId The navbar which triggers show hide
19 * Create a new TabPanel
20 * @param {Object} config The config object
23 Roo.bootstrap.TabPanel = function(config){
24 Roo.bootstrap.TabPanel.superclass.constructor.call(this, config);
28 * Fires when the active status changes
29 * @param {Roo.bootstrap.TabPanel} this
30 * @param {Boolean} state the new state
37 Roo.extend(Roo.bootstrap.TabPanel, Roo.bootstrap.Component, {
44 getAutoCreate : function(){
56 cfg.tabId = this.tabId;
61 onRender : function(ct, position)
63 // Roo.log("Call onRender: " + this.xtype);
65 Roo.bootstrap.TabPanel.superclass.onRender.call(this, ct, position);
67 if (this.navId && this.tabId) {
68 var item = Roo.bootstrap.NavGroup.get(this.navId).getNavItem(this.tabId);
70 Roo.log("could not find navID:" + this.navId + ", tabId: " + this.tabId);
72 item.on('changed', function(item, state) {
73 this.setActive(state);
79 setActive: function(state)
81 Roo.log("panel - set active " + this.tabId + "=" + state);
85 this.el.removeClass('active');
87 } else if (!this.el.hasClass('active')) {
88 this.el.addClass('active');
90 this.fireEvent('changed', this, state);