10 * @class Roo.bootstrap.ButtonGroup
11 * @extends Roo.bootstrap.Component
12 * Bootstrap ButtonGroup class
13 * @cfg {String} size lg | sm | xs (default empty normal)
14 * @cfg {String} align vertical | justified (default none)
15 * @cfg {String} direction up | down (default down)
16 * @cfg {Boolean} toolbar false | true
17 * @cfg {Boolean} btn true | false
22 * @param {Object} config The config object
25 Roo.bootstrap.ButtonGroup = function(config){
26 Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
29 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, {
37 getAutoCreate : function(){
43 cfg.html = this.html || cfg.html;
54 if (['vertical','justified'].indexOf(this.align)!==-1) {
55 cfg.cls = 'btn-group-' + this.align;
57 if (this.align == 'justified') {
58 console.log(this.items);
62 if (['lg','sm','xs'].indexOf(this.size)!==-1) {
63 cfg.cls += ' btn-group-' + this.size;
66 if (this.direction == 'up') {
67 cfg.cls += ' dropup' ;
73 * Add a button to the group (similar to NavItem API.)
75 addItem : function(cfg)
77 var cn = new Roo.bootstrap.Button(cfg);
79 cn.parentId = this.id;
80 cn.onRender(this.el, null);