Roo/bootstrap/ButtonGroup.js
authorAlan Knowles <alan@roojs.com>
Wed, 28 Nov 2018 08:42:01 +0000 (16:42 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 28 Nov 2018 08:42:01 +0000 (16:42 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/ButtonGroup.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 47db4be..4c50892 100644 (file)
@@ -68,6 +68,17 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component,  {
         }
         
         return cfg;
+    },
+    /**
+     * Add a button to the group (similar to NavItem API.)
+     */
+    addItem : function(cfg)
+    {
+        var cn = new Roo.bootstrap.Button(cfg);
+        //this.register(cn);
+        cn.parentId = this.id;
+        cn.onRender(this.el, null);
+        return cn;
     }
    
 });
index 261a7d3..8b1c378 100644 (file)
@@ -554,6 +554,17 @@ Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component,  {
         }
         
         return cfg;
+    },
+    /**
+     * Add a button to the group (similar to NavItem API.)
+     */
+    addItem : function(cfg)
+    {
+        var cn = new Roo.bootstrap.Button(cfg);
+        //this.register(cn);
+        cn.parentId = this.id;
+        cn.onRender(this.el, null);
+        return cn;
     }
    
 });
index 4ed50fa..76687bc 100644 (file)
@@ -21,7 +21,7 @@ Roo.bootstrap.Body=function(A){A=A||{};Roo.bootstrap.Body.superclass.constructor
 // Roo/bootstrap/ButtonGroup.js
 Roo.bootstrap.ButtonGroup=function(A){Roo.bootstrap.ButtonGroup.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.ButtonGroup,Roo.bootstrap.Component,{size:'',align:'',direction:'',toolbar:false,btn:true,getAutoCreate:function(){var A={cls:'btn-group',html:null}
 ;A.html=this.html||A.html;if(this.toolbar){A={cls:'btn-toolbar',html:null};return A;}if(['vertical','justified'].indexOf(this.align)!==-1){A.cls='btn-group-'+this.align;if(this.align=='justified'){console.log(this.items);}}if(['lg','sm','xs'].indexOf(this.size)!==-1){A.cls+=' btn-group-'+this.size;
-}if(this.direction=='up'){A.cls+=' dropup';}return A;}});
+}if(this.direction=='up'){A.cls+=' dropup';}return A;},addItem:function(A){var cn=new Roo.bootstrap.Button(A);cn.parentId=this.id;cn.onRender(this.el,null);return cn;}});
 // Roo/bootstrap/Button.js
 Roo.bootstrap.Button=function(A){Roo.bootstrap.Button.superclass.constructor.call(this,A);this.weightClass=["btn-default","btn-primary","btn-success","btn-info","btn-warning","btn-danger","btn-link"],this.addEvents({"click":true,"toggle":true});};Roo.extend(Roo.bootstrap.Button,Roo.bootstrap.Component,{html:false,active:false,weight:'',size:'',tag:'button',href:'',disabled:false,isClose:false,glyphicon:'',badge:'',theme:'default',inverse:false,toggle:false,ontext:'ON',offtext:'OFF',defaulton:true,preventDefault:true,removeClass:false,name:false,target:false,pressed:null,getAutoCreate:function(){var A={tag:'button',cls:'roo-button',html:''}
 ;if(['a','button','input','submit'].indexOf(this.tag)<0){throw "Invalid value for tag: "+this.tag+". must be a, button, input or submit.";this.tag='button';}else{A.tag=this.tag;}A.html='<span class="roo-button-text">'+(this.html||A.html)+'</span>';if(this.toggle==true){A={tag:'div',cls:'slider-frame roo-button',cn:[{tag:'span','data-on-text':'ON','data-off-text':'OFF',cls:'slider-button',html:this.offtext}