10 * @class Roo.bootstrap.ButtonGroup
11 * @extends Roo.bootstrap.Component
12 * Bootstrap ButtonGroup class
13 * @children Roo.bootstrap.Button Roo.bootstrap.form.Form
15 * @cfg {String} size lg | sm | xs (default empty normal)
16 * @cfg {String} align vertical | justified (default none)
17 * @cfg {String} direction up | down (default down)
18 * @cfg {Boolean} toolbar false | true
19 * @cfg {Boolean} btn true | false
24 * @param {Object} config The config object
27 Roo.bootstrap.ButtonGroup = function(config){
28 Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
31 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, {
39 getAutoCreate : function(){
45 cfg.html = this.html || cfg.html;
56 if (['vertical','justified'].indexOf(this.align)!==-1) {
57 cfg.cls = 'btn-group-' + this.align;
59 if (this.align == 'justified') {
60 console.log(this.items);
64 if (['lg','sm','xs'].indexOf(this.size)!==-1) {
65 cfg.cls += ' btn-group-' + this.size;
68 if (this.direction == 'up') {
69 cfg.cls += ' dropup' ;
75 * Add a button to the group (similar to NavItem API.)
77 addItem : function(cfg)
79 var cn = new Roo.bootstrap.Button(cfg);
81 cn.parentId = this.id;
82 cn.onRender(this.el, null);