* @cfg {String} panel (success | info | warning | danger )
* @cfg {String} role role of the progress bar
* @cfg {String} sr_only text
- * @cfg {Number} width percentages of the bar
*
*
* @constructor
panel : false,
role : false,
sr_only: false,
- width : false,
- getAutoCreate : function(){
+ getAutoCreate : function()
+ {
var cfg = {
tag: 'div',
cls: 'progress-bar',
- style: 'width:' + (this.aria_valuenow / this.aria_valuemax )
+ style: 'width:' + Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%'
};
if(this.sr_only){
}
}
- if(this.width){
-
- }
-
if(this.role){
cfg.role = this.role;
}
}
return cfg;
+ },
+
+ update : function(aria_valuenow)
+ {
+ this.aria_valuenow = aria_valuenow;
+
+ this.el.setStyle('width', Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%');
}
});