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()
44 cls : 'roo-alert-icon'
49 cls : 'roo-alert-title',
54 cls : 'roo-alert-text',
61 cfg.cn[0].cls += ' fa ' + this.faicon;
65 cfg.cls += ' alert-' + this.weight;
71 initEvents: function()
73 this.el.setVisibilityMode(Roo.Element.DISPLAY);
76 setTitle : function(str)
78 this.el.select('.roo-alert-title',true).first().dom.innerHTML = str;
81 setText : function(str)
83 this.el.select('.roo-alert-text',true).first().dom.innerHTML = str;
86 setWeight : function(weight)
89 this.el.select('.alert',true).first().removeClass('alert-' + this.weight);
94 this.el.select('.alert',true).first().addClass('alert-' + this.weight);
97 setIcon : function(icon)
100 this.el.select('.roo-alert-icon',true).first().removeClass(['fa', 'fa-' + this.faicon]);
105 this.el.select('.roo-alert-icon',true).first().addClass(['fa', 'fa-' + this.faicon]);