Roo/bootstrap/NavSidebarItem.js
authoredward <edward@roojs.com>
Mon, 21 Mar 2016 05:34:53 +0000 (13:34 +0800)
committeredward <edward@roojs.com>
Mon, 21 Mar 2016 05:34:53 +0000 (13:34 +0800)
Roo/bootstrap/NavSidebarItem.js

index 8f7b956..3fc73a0 100644 (file)
@@ -111,6 +111,32 @@ Roo.extend(Roo.bootstrap.NavSidebarItem, Roo.bootstrap.NavItem,  {
         }
         
         this.fireEvent('click', this);
+    },
+    
+    disable : function()
+    {
+        this.setDisabled(true);
+    },
+    
+    enable : function()
+    {
+        this.setDisabled(false);
+    },
+    
+    setDisabled : function(state)
+    {
+        if(this.disabled == state){
+            return;
+        }
+        
+        this.disabled = state;
+        
+        if (state) {
+            this.el.addClass('disabled');
+            return;
+        }
+        
+        this.el.removeClass('disabled');
     }