9642aa94c0c67f11914760f91f9a033583c94b6d
[roojs1] / docs / symbols / src / Roo_bootstrap_NavProgressBar.js.html
1 <html><head><title>../roojs1/Roo/bootstrap/NavProgressBar.js</title><link rel="stylesheet" type="text/css" href="../../../css/highlight-js.css"/></head><body class="highlightpage"><code class="jsdoc-pretty"><span class="jsdoc-comment">/*
2  * - LGPL
3  *
4  * nav progress bar
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.NavProgressBar
10  * @extends Roo.bootstrap.Component
11  * Bootstrap NavProgressBar class
12  * @cfg {String} navId - reference Id for nav progress bar.
13  * 
14  * @constructor
15  * Create a new nav progress bar
16  * @param {Object} config The config object
17  */
18
19 </span><span class="jsdoc-var">Roo.bootstrap.NavProgressBar </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">){
20     </span><span class="jsdoc-var">Roo.bootstrap.NavProgressBar.superclass.constructor.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">config</span><span class="jsdoc-syntax">);
21     </span><span class="jsdoc-var">this.items </span><span class="jsdoc-syntax">= [];
22    
23 </span><span class="jsdoc-comment">//    Roo.bootstrap.NavProgressBar.register(this);
24      </span><span class="jsdoc-var">this.addEvents</span><span class="jsdoc-syntax">({
25         </span><span class="jsdoc-comment">/**
26              * @event changed
27              * Fires when the active item changes
28              * @param {Roo.bootstrap.NavProgressBar} this
29              * @param {Roo.bootstrap.NavProgressItem} selected The item selected
30              * @param {Roo.bootstrap.NavProgressItem} prev The previously selected item 
31          */
32         </span><span class="jsdoc-string">'changed'</span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">true
33      </span><span class="jsdoc-syntax">});
34     
35 };
36
37 </span><span class="jsdoc-var">Roo.extend</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">Roo.bootstrap.NavProgressBar</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">Roo.bootstrap.Component</span><span class="jsdoc-syntax">,  {
38     
39     </span><span class="jsdoc-var">items </span><span class="jsdoc-syntax">: [],
40     </span><span class="jsdoc-var">navId </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">''</span><span class="jsdoc-syntax">,
41     
42     </span><span class="jsdoc-var">getAutoCreate </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">()
43     {
44         </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">cfg </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">Roo.apply</span><span class="jsdoc-syntax">({}, </span><span class="jsdoc-var">Roo.bootstrap.NavProgressBar.superclass.getAutoCreate.call</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this</span><span class="jsdoc-syntax">));
45         
46         </span><span class="jsdoc-var">cfg </span><span class="jsdoc-syntax">= {
47             </span><span class="jsdoc-var">tag </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'ul'</span><span class="jsdoc-syntax">,
48             </span><span class="jsdoc-var">cls</span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">'roo-navigation-bar' 
49         </span><span class="jsdoc-syntax">}
50         
51         </span><span class="jsdoc-keyword">return </span><span class="jsdoc-var">cfg</span><span class="jsdoc-syntax">;
52     }
53 </span><span class="jsdoc-comment">//    
54 //    /**
55 //    * sets the active Navigation item
56 //    * @param {Roo.bootstrap.NavProgressItem} the new current navitem
57 //    */
58 //    setActiveItem : function(item)
59 //    {
60 //        var prev = false;
61 //        Roo.each(this.items, function(v){
62 //            if (v == item) {
63 //                return ;
64 //            }
65 //            if (v.isActive()) {
66 //                v.setActive(false, true);
67 //                prev = v;
68 //                
69 //            }
70 //            
71 //        });
72 //
73 //        item.setActive(true, true);
74 //        this.fireEvent('changed', this, item, prev);
75 //    },
76 //    
77 //    /**
78 //    * gets the active Navigation item
79 //    * @return {Roo.bootstrap.NavProgressItem} the current navitem
80 //    */
81 //    getActive : function()
82 //    {
83 //        var active = false;
84 //        
85 //        Roo.each(this.items, function(v){
86 //            
87 //            if (!v.isActive()) {
88 //                return;
89 //            }
90 //            
91 //            active = v;
92 //            return false;
93 //            
94 //        });
95 //        
96 //        return active;
97 //    },
98 //    
99 //    indexOfNav : function(item)
100 //    {
101 //        var index = false;
102 //        
103 //        Roo.each(this.items, function(v,i){
104 //            
105 //            if (v != item) {
106 //                return;
107 //            }
108 //            
109 //            index = i;
110 //            return false
111 //        });
112 //        
113 //        return index;
114 //    },
115 //    
116 //    /**
117 //    * adds a Navigation item
118 //    * @param {Roo.bootstrap.NavProgressItem} the NavProgressItem to add
119 //    */
120 //    addItem : function(cfg)
121 //    {
122 //        var cn = new Roo.bootstrap.NavProgressItem(cfg);
123 //        this.register(cn);
124 //        cn.parentId = this.id;
125 //        cn.onRender(this.el, null);
126 //        return cn;
127 //    },
128 //    
129 //    /**
130 //    * register a Navigation item
131 //    * @param {Roo.bootstrap.NavItem} the navitem to add
132 //    */
133 //    register : function(item)
134 //    {
135 //        this.items.push(item);
136 //        item.navId = this.navId;
137 //    
138 //    },
139 //    
140 //    /**
141 //    * clear all the Navigation item
142 //    */
143 //   
144 //    clearAll : function()
145 //    {
146 //        this.items = [];
147 //        this.el.dom.innerHTML = '';
148 //    },
149 //    
150 //    getNavItem: function(tabId)
151 //    {
152 //        var ret = false;
153 //        Roo.each(this.items, function(e) {
154 //            if (e.tabId == tabId) {
155 //               ret =  e;
156 //               return false;
157 //            }
158 //            return true;
159 //            
160 //        });
161 //        return ret;
162 //    },
163 //    
164 //    setActiveNext : function()
165 //    {
166 //        var i = this.indexOfNav(this.getActive());
167 //        
168 //        if (i &gt; this.items.length) {
169 //            return;
170 //        }
171 //        
172 //        this.setActiveItem(this.items[i+1]);
173 //    },
174 //    
175 //    setActivePrev : function()
176 //    {
177 //        var i = this.indexOfNav(this.getActive());
178 //        
179 //        if (i  &lt; 1) {
180 //            return;
181 //        }
182 //        
183 //        this.setActiveItem(this.items[i-1]);
184 //    },
185 //    
186 //    clearWasActive : function(except) {
187 //        Roo.each(this.items, function(e) {
188 //            if (e.tabId != except.tabId &amp;&amp; e.was_active) {
189 //               e.was_active = false;
190 //               return false;
191 //            }
192 //            return true;
193 //            
194 //        });
195 //    },
196 //    
197 //    getWasActive : function ()
198 //    {
199 //        var r = false;
200 //        Roo.each(this.items, function(e) {
201 //            if (e.was_active) {
202 //               r = e;
203 //               return false;
204 //            }
205 //            return true;
206 //            
207 //        });
208 //        return r;
209 //    }
210     
211     
212 </span><span class="jsdoc-syntax">});
213
214 </span><span class="jsdoc-comment">// 
215 //Roo.apply(Roo.bootstrap.NavProgressBar, {
216 //    
217 //    groups: {},
218 //     /**
219 //    * register a Navigation Group
220 //    * @param {Roo.bootstrap.NavGroup} the navgroup to add
221 //    */
222 //    register : function(bar)
223 //    {
224 //        this.groups[bar.navId] = bar;
225 //      
226 //    },
227 //    /**
228 //    * fetch a Navigation Bar based on the navigation ID
229 //    * @param {string} the nav bar to add
230 //    * @returns {Roo.bootstrap.NavProgressBar} the nav bar
231 //    */
232 //    get: function(navId) 
233 //    {
234 //        if (typeof(this.groups[navId]) == 'undefined') {
235 //            return false;
236 //        }
237 //        
238 //        return this.groups[navId] ;
239 //    }
240 //    
241 //});
242
243  </span></code></body></html>