allow string based values for comboboxarray
[roojs1] / Roo / bootstrap / ProgressBar.js
index 2496147..d0c0f3b 100644 (file)
@@ -29,7 +29,7 @@ Roo.bootstrap.ProgressBar = function(config){
 
 Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
     
-    aria_valuenow : false,
+    aria_valuenow : 0,
     aria_valuemin : 0,
     aria_valuemax : 100,
     label : false,
@@ -37,10 +37,13 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
     role : false,
     sr_only: false,
     
-    getAutoCreate : function(){
+    getAutoCreate : function()
+    {
+        
         var cfg = {
             tag: 'div',
-            cls: 'progress-bar'
+            cls: 'progress-bar',
+            style: 'width:' + Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%'
         };
         
         if(this.sr_only){
@@ -59,6 +62,14 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
             cfg['aria-valuenow'] = this.aria_valuenow;
         }
         
+        if(this.aria_valuemin){
+            cfg['aria-valuemin'] = this.aria_valuemin;
+        }
+        
+        if(this.aria_valuemax){
+            cfg['aria-valuemax'] = this.aria_valuemax;
+        }
+        
         if(this.label && !this.sr_only){
             cfg.html = this.label;
         }
@@ -68,6 +79,13 @@ Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component,  {
         }
         
         return cfg;
+    },
+    
+    update : function(aria_valuenow)
+    {
+        this.aria_valuenow = aria_valuenow;
+        
+        this.el.setStyle('width', Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%');
     }
    
 });