9 * @class Roo.bootstrap.Alert
10 * @extends Roo.bootstrap.Component
11 * Bootstrap Alert class
12 * @cfg {String} title The title of alert
13 * @cfg {String} html The content of alert
14 * @cfg {String} weight ( success | info | warning | danger )
15 * @cfg {String} faicon font-awesomeicon
19 * @param {Object} config The config object
23 Roo.bootstrap.Alert = function(config){
24 Roo.bootstrap.Alert.superclass.constructor.call(this, config);
28 Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, {
35 getAutoCreate : function()
48 cls : 'roo-alert-title',
53 cls : 'roo-alert-text',
60 cfg.cn[0].cls = 'fa ' + this.faicon;
64 cfg.cls += ' alert-' + this.weight;
70 initEvents: function()
72 this.el.setVisibilityMode(Roo.Element.DISPLAY);
75 setTitle : function(str)
77 this.el.select('.roo-alert-title',true).first().dom.innerHTML = str;
80 setText : function(str)
82 this.el.select('.roo-alert-text',true).first().dom.innerHTML = str;
85 setWeight : function(weight)
88 this.el.select('.alert',true).first().removeClass('alert-' + this.weight);
93 this.el.select('.alert',true).first().addClass('alert-' + this.weight);
96 setIcon : function(str)
101 this.el.select('.roo-alert-text',true).first().dom.innerHTML = str;