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-title',
49 cls : 'roo-alert-text',
58 cls : 'fa ' + this.faicon
63 cfg.cls += ' alert-' + this.weight;
69 initEvents: function()
71 this.el.setVisibilityMode(Roo.Element.DISPLAY);
74 setTitle : function(str)
76 this.el.select('.roo-alert-title',true).first().dom.innerHTML = str;
79 setText : function(str)
81 this.el.select('.roo-alert-text',true).first().dom.innerHTML = str;
84 setWeight : function(weight)
87 this.el.select('.alert',true).first().removeClass('alert-' + this.weight);
92 this.el.select('.alert',true).first().addClass('alert-' + this.weight);
95 setIcon : function(str)
97 this.el.select('.roo-alert-text',true).first().dom.innerHTML = str;