allow string based values for comboboxarray
[roojs1] / Roo / bootstrap / NavSidebarItem.js
index 69573bb..893b962 100644 (file)
@@ -18,6 +18,7 @@
  * {Boolean} buttonView use button as the tigger el rather that a (default false)
  * {String} buttonWeight (default|primary|success|info|warning|danger)the extra classes for the button
  * {String} buttonSize (sm|md|lg)the extra classes for the button
+ * {Boolean} showArrow show arrow next to the text (default true)
  * @constructor
  * Create a new Navbar Button
  * @param {Object} config The config object
@@ -56,6 +57,8 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
     
     buttonSize : 'md',
     
+    showArrow : true,
+    
     getAutoCreate : function(){
         
         
@@ -71,10 +74,10 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
             a = {
                 tag: 'button',
                 href : this.href || '#',
-                cls: 'btn btn-' + this.buttonWeight + ' btn-' + this.buttonSize,
+                cls: 'btn btn-' + this.buttonWeight + ' btn-' + this.buttonSize + 'roo-button-dropdown-toggle',
                 html : this.html,
                 cn : []
-        };
+            };
         }
         
         var cfg = {
@@ -107,22 +110,22 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
 
             a.cn.push(span);
             
-            if (this.badge !== '') {
-                a.cn.push({ tag: 'span',  cls : 'badge pull-right badge-' + this.badgeWeight, html: this.badge }); 
-            }
         }
         
-        // then badge..
+        if (this.badge !== '') {
+            a.cn.push({ tag: 'span',  cls : 'badge pull-right badge-' + this.badgeWeight, html: this.badge }); 
+        }
         
-        // fi
         if (this.menu) {
-            a.cn.push({ tag : 'i', cls : 'glyphicon glyphicon-chevron-down pull-right'});
-            a.cls += 'dropdown-toggle treeview' ;
+            
+            if(this.showArrow){
+                a.cn.push({ tag : 'i', cls : 'glyphicon glyphicon-chevron-down pull-right'});
+            }
+            
+            a.cls += ' dropdown-toggle treeview' ;
         }
         
         return cfg;
-         
-          
     },
     
     initEvents : function()
@@ -136,7 +139,6 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
         this.el.on('click', this.onClick, this);
         
         if(this.badge !== ''){
             this.badgeEl = this.el.select('.badge', true).first().setVisibilityMode(Roo.Element.DISPLAY);
         }
         
@@ -153,7 +155,7 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
             e.preventDefault();
         }
         
-        this.fireEvent('click', this);
+        this.fireEvent('click', this, e);
     },
     
     disable : function()