Roo/bootstrap/MessageBar.js
authorEdward <edward@roojs.com>
Wed, 4 Jun 2014 06:12:03 +0000 (14:12 +0800)
committerEdward <edward@roojs.com>
Wed, 4 Jun 2014 06:12:03 +0000 (14:12 +0800)
Roo/bootstrap/MessageBar.js

index 0064417..48c2179 100644 (file)
@@ -11,6 +11,7 @@
  * Bootstrap MessageBar class
  * @cfg {String} html contents of the MessageBar
  * @cfg {String} weight (info | success | warning | danger) default info
+ * @cfg {Boolean} closable (true | false) default true
  * 
  * @constructor
  * Create a new Element
@@ -25,7 +26,7 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
     
     html: '',
     weight: 'info',
-     
+    closable: true,
     
     getAutoCreate : function(){
         
@@ -35,6 +36,13 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
             html: this.html || ''
         }
         
+        if(this.closable){
+            cfg.cn = {
+                tag: 'button',
+                cls: 'close'
+            }
+        }
+        
         return cfg;
     }