4 * base class for bootstrap elements.
8 Roo.bootstrap = Roo.bootstrap || {};
10 * @class Roo.bootstrap.Component
11 * @extends Roo.Component
12 * Bootstrap Component base class
13 * @cfg {String} cls css class
14 * @cfg {String} style any extra css
17 * Do not use directly - it does not do anything..
18 * @param {Object} config The config object
23 Roo.bootstrap.Component = function(config){
24 Roo.bootstrap.Component.superclass.constructor.call(this, config);
27 Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, {
35 initEvents : function() { },
40 // returns the parent component..
41 return Roo.ComponentMgr.get(this.parentId)
47 onRender : function(ct, position)
49 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
53 var cfg = Roo.apply({}, this.getAutoCreate());
57 cfg.cls += ' ' + this.cls;
59 if (this.style) { // fixme needs to support more complex style data.
60 cfg.style = this.style;
62 this.el = ct.createChild(cfg, position);
63 if(this.tabIndex !== undefined){
64 this.el.dom.setAttribute('tabIndex', this.tabIndex);
71 getChildContainer : function()
76 addxtype : function (tree, cntr) {
78 cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
80 if (tree.xtype != 'Body') {
82 cn = Roo.factory(tree);
84 cn.parentType = this.xtype; //??
85 cn.parentId = this.id;
86 cn.render(this[cntr]());
87 // then add the element..
90 if (typeof (tree.menu) != 'undefined') {
91 tree.menu.parentType = cn.xtype;
92 tree.menu.triggerEl = cn.el;
93 nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
96 if (typeof (tree.buttons) != 'undefined' && typeof(cn.getButtonContainer) == 'function') {
98 for(var i =0;i < tree.buttons.length;i++) {
99 nitems.push(cn.addxtype(Roo.apply({}, tree.buttons[i]), 'getButtonContainer'));
104 if (!tree.items || !tree.items.length) {
108 var items = tree.items;
111 //Roo.log(items.length);
113 for(var i =0;i < items.length;i++) {
114 nitems.push(cn.addxtype(Roo.apply({}, items[i])));