10 * @class Roo.bootstrap.Container
11 * @extends Roo.bootstrap.Component
12 * Bootstrap Container class
13 * @cfg {Boolean} jumbotron is it a jumbotron element
14 * @cfg {String} html content of element
15 * @cfg {String} well (lg|sm|md) a well, large, small or medium.
16 * @cfg {String} panel (primary|success|info|warning|danger) render as a panel.
17 * @cfg {String} header content of header (for panel)
18 * @cfg {String} footer content of footer (for panel)
19 * @cfg {String} sticky (footer|wrap|push) block to use as footer or body- needs css-bootstrap/sticky-footer.css
20 * @cfg {String} tag (header|aside|section) type of HTML tag.
21 * @cfg {String} alert (success|info|warning|danger) type alert (changes background / border...)
22 * @cfg {String} fa (ban|check|...) font awesome icon
23 * @cfg {String} icon (info-sign|check|...) glyphicon name
24 * @cfg {Boolean} hidden (true|false) hide the element
25 * @cfg {Boolean} expandable (true|false) default false
26 * @cfg {String} rheader contet on the right of header
30 * Create a new Container
31 * @param {Object} config The config object
34 Roo.bootstrap.Container = function(config){
35 Roo.bootstrap.Container.superclass.constructor.call(this, config);
38 Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
54 getChildContainer : function() {
60 if (this.panel.length) {
61 return this.el.select('.panel-body',true).first();
68 getAutoCreate : function(){
71 tag : this.tag || 'div',
76 cfg.cls = 'jumbotron';
81 // - this is applied by the parent..
83 // cfg.cls = this.cls + '';
86 if (this.sticky.length) {
88 var bd = Roo.get(document.body);
89 if (!bd.hasClass('bootstrap-sticky')) {
90 bd.addClass('bootstrap-sticky');
91 Roo.select('html',true).setStyle('height', '100%');
94 cfg.cls += 'bootstrap-sticky-' + this.sticky;
98 if (this.well.length) {
102 cfg.cls +=' well well-' +this.well;
111 cfg.cls += ' hidden';
115 if (this.alert && ["success","info","warning", "danger"].indexOf(this.alert) > -1) {
116 cfg.cls +=' alert alert-' + this.alert;
121 if (this.panel.length) {
122 cfg.cls += ' panel panel-' + this.panel;
124 if (this.header.length) {
143 cls: 'panel-header-right',
149 cls : 'panel-heading',
162 if (this.footer.length) {
164 cls : 'panel-footer',
173 body.html = this.html || cfg.html;
174 // prefix with the icons..
176 body.html = '<i class="fa fa-'+this.fa + '"></i>' + body.html ;
179 body.html = '<i class="glyphicon glyphicon-'+this.icon + '"></i>' + body.html ;
184 if ((!this.cls || !this.cls.length) && (!cfg.cls || !cfg.cls.length)) {
185 cfg.cls = 'container';
191 initEvents: function()
193 var toggleEl = this.toggleEl();
199 toggleEl.on('click', this.onToggleClick, this);
202 onToggleClick : function()
207 toggleEl : function()
209 if(!this.el || !this.panel.length || !this.header.length || !this.expandable){
213 return this.el.select('.panel-heading .fa',true).first();
218 if(!this.el || !this.panel.length || !this.header.length){
222 return this.el.select('.panel-title',true).first();
225 setTitle : function(v)
227 var titleEl = this.titleEl();
233 titleEl.dom.innerHTML = v;
236 getTitle : function()
239 var titleEl = this.titleEl();
245 return titleEl.dom.innerHTML;