Roo/bootstrap/Progress.js
[roojs1] / Roo / bootstrap / Progress.js
1 /*
2  * - LGPL
3  *
4  * Progress
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.Progress
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Progress class
12  * @cfg {Number} aria_valuenow aria-value now
13  * @cfg {Number} aria_valuemin aria-value min
14  * @cfg {Number} aria_valuemax aria-value max
15  * @cfg {String} label label for the progress bar
16  * @cfg {String} panel (success | info | warning | danger )
17  * @cfg {String} role role of the progress bar
18  * 
19  * 
20  * @constructor
21  * Create a new Progress
22  * @param {Object} config The config object
23  */
24
25 Roo.bootstrap.Progress = function(config){
26     Roo.bootstrap.Progress.superclass.constructor.call(this, config);
27 };
28
29 Roo.extend(Roo.bootstrap.Progress, Roo.bootstrap.Component,  {
30     
31     aria_valuenow : false,
32     aria_valuemin : 0,
33     aria_valuemax : 100,
34     label : false,
35     panel : false,
36     
37     getAutoCreate : function(){
38         var cfg = {
39             tag: 'div',
40             cls: 'progress',
41             cn: [
42                 {
43                     tag: 'div',
44                     cls: 'progress-bar'
45                 }
46             ]
47         };
48       
49         if(this.aria_valuenow){
50             cfg.cn[0]['aria-valuenow'] = this.aria_valuenow;
51         }
52         
53         if(this.label){
54             cfg.cn[0].html = this.label;
55         }
56         
57         if(this.panel){
58             cfg.cn[0].cls += 'progress-bar-' + this.panel;
59         }
60         
61         return cfg;
62     }
63    
64 });
65
66  
67
68