examples/bootstrap/dashboard3.bjs
[roojs1] / examples / bootstrap / dashboard3.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 dashboard3 = new Roo.XComponent({
6     part     :  ["bootstrap", "dashboard3" ],
7     order    : '001-dashboard-',
8     region   : 'center',
9     parent   : false,
10     name     : "unnamed module",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             '|xns' : 'Roo.bootstrap',
19             cls : 'skin-blue',
20             xtype : 'Body',
21             xns : Roo.bootstrap,
22             items : [
23                 Roo.apply(Dashboard.Header1._tree(), {
24                     '|xns' : 'Roo.bootstrap',
25                     cls : 'header',
26                     tag : 'header',
27                     xtype : 'Container',
28                     xns : Roo.bootstrap
29                 }),
30                 {
31                     '|xns' : 'Roo.bootstrap',
32                     cls : 'wrapper row-offcanvas row-offcanvas-left',
33                     xtype : 'Container',
34                     'flexy:include' : 'Sidebar.html',
35                     xns : Roo.bootstrap,
36                     items : [
37                         Roo.apply(Dashboard.Sidebar2._tree(), {
38                             '|xns' : 'Roo.bootstrap',
39                             tag : 'aside',
40                             cls : 'left-side sidebar-offcanvas',
41                             xtype : 'Container',
42                             xns : Roo.bootstrap
43                         }),
44                         {
45                             '|xns' : 'Roo.bootstrap',
46                             tag : 'aside',
47                             cls : 'right-side',
48                             xtype : 'Container',
49                             xns : Roo.bootstrap,
50                             items : [
51                                 {
52                                     '|xns' : 'Roo.bootstrap',
53                                     tag : 'section',
54                                     cls : 'content-header',
55                                     xtype : 'Container',
56                                     xns : Roo.bootstrap,
57                                     items : [
58                                         {
59                                             '|xns' : 'Roo.bootstrap',
60                                             xtype : 'Header',
61                                             xns : Roo.bootstrap,
62                                             html : 'Dashboard  <small> Control panel </small>'
63                                         }
64                                     ]
65
66                                 },
67                                 {
68                                     '|xns' : 'Roo.bootstrap',
69                                     tag : 'section',
70                                     cls : 'content',
71                                     xtype : 'Container',
72                                     xns : Roo.bootstrap,
73                                     items : [
74                                         {
75                                             '|xns' : 'Roo.bootstrap',
76                                             xtype : 'Container',
77                                             xns : Roo.bootstrap,
78                                             items : [
79                                                 {
80                                                     '|xns' : 'Roo.bootstrap',
81                                                     md : 3,
82                                                     xtype : 'Column',
83                                                     lg : 3,
84                                                     xns : Roo.bootstrap,
85                                                     items : [
86                                                         {
87                                                             '|xns' : 'Roo.bootstrap.dash',
88                                                             bgcolor : '',
89                                                             cls : '',
90                                                             xtype : 'NumberBox',
91                                                             headline : 160,
92                                                             xns : Roo.bootstrap.dash,
93                                                             width : 'col-md-5',
94                                                             title : "New Orders",
95                                                             style : 'col-md-3',
96                                                             height : 150
97                                                         }
98                                                     ]
99
100                                                 },
101                                                 {
102                                                     '|xns' : 'Roo.bootstrap',
103                                                     md : 3,
104                                                     xtype : 'Column',
105                                                     lg : 3,
106                                                     xns : Roo.bootstrap,
107                                                     items : [
108                                                         {
109                                                             '|xns' : 'Roo.bootstrap.dash',
110                                                             bgcolor : 'green',
111                                                             cls : '',
112                                                             xtype : 'NumberBox',
113                                                             headline : 150,
114                                                             xns : Roo.bootstrap.dash,
115                                                             width : 'col-md-5',
116                                                             title : "New Orders",
117                                                             style : 'col-lg-3',
118                                                             height : 150
119                                                         }
120                                                     ]
121
122                                                 },
123                                                 {
124                                                     '|xns' : 'Roo.bootstrap',
125                                                     md : 3,
126                                                     xtype : 'Column',
127                                                     lg : 3,
128                                                     xns : Roo.bootstrap,
129                                                     items : [
130                                                         {
131                                                             '|xns' : 'Roo.bootstrap.dash',
132                                                             bgcolor : 'yellow',
133                                                             xtype : 'NumberBox',
134                                                             headline : 150,
135                                                             xns : Roo.bootstrap.dash,
136                                                             width : 'col-md-5',
137                                                             title : "New Orders",
138                                                             style : 'col-lg-3',
139                                                             height : 150
140                                                         }
141                                                     ]
142
143                                                 },
144                                                 {
145                                                     '|xns' : 'Roo.bootstrap',
146                                                     md : 3,
147                                                     lg : 3,
148                                                     xtype : 'Column',
149                                                     xns : Roo.bootstrap,
150                                                     items : [
151                                                         {
152                                                             '|xns' : 'Roo.bootstrap.dash',
153                                                             bgcolor : 'red',
154                                                             xtype : 'NumberBox',
155                                                             headline : 150,
156                                                             xns : Roo.bootstrap.dash,
157                                                             width : '',
158                                                             title : "New Orders",
159                                                             style : 'col-lg-3',
160                                                             height : 150
161                                                         }
162                                                     ]
163
164                                                 }
165                                             ]
166
167                                         },
168                                         {
169                                             '|xns' : 'Roo.bootstrap',
170                                             xtype : 'Row',
171                                             xns : Roo.bootstrap,
172                                             items : [
173                                                 {
174                                                     '|xns' : 'Roo.bootstrap',
175                                                     cls : 'alert alert-danger ',
176                                                     xtype : 'Container',
177                                                     xns : Roo.bootstrap,
178                                                     html : '<i class=\"fa fa-ban\"></i><b> Alert </b> test allert'
179                                                 }
180                                             ]
181
182                                         },
183                                         {
184                                             '|xns' : 'Roo.bootstrap',
185                                             xtype : 'Row',
186                                             xns : Roo.bootstrap,
187                                             items : [
188                                                 {
189                                                     '|xns' : 'Roo.bootstrap',
190                                                     md : 6,
191                                                     xtype : 'Column',
192                                                     lg : 6,
193                                                     xns : Roo.bootstrap,
194                                                     style : '',
195                                                     sm : 12,
196                                                     items : [
197                                                         {
198                                                             '|xns' : 'Roo.bootstrap.dash',
199                                                             xtype : 'TabBox',
200                                                             xns : Roo.bootstrap.dash,
201                                                             title : "test 1",
202                                                             listeners : {
203                                                                 render : function (_self)
204                                                                    {
205                                                                        _this.testbox = _self;
206                                                                    }
207                                                             },
208                                                             items : [
209                                                                 {
210                                                                     '|xns' : 'Roo.bootstrap.dash',
211                                                                     xtype : 'TabPane',
212                                                                     xns : Roo.bootstrap.dash,
213                                                                     title : "tab 1",
214                                                                     items : [
215                                                                         {
216                                                                             '|xns' : 'Roo.bootstrap',
217                                                                             xtype : 'Column',
218                                                                             xns : Roo.bootstrap,
219                                                                             items : [
220                                                                                 {
221                                                                                     store : {
222                                                                                         '|xns' : 'Roo.data',
223                                                                                         data : [
224                                                                                           [ 'A TEST', '1', '0' ],
225                                                                                           
226                                                                                             [ 'B test', '1', '0' ],
227                                                                                               [ 'C test', '1', '0' ],
228                                                                                             [ 'D test', '1', '0' ]
229                                                                                         ],
230                                                                                         isLocal : true,
231                                                                                         fields : [ 'display_name', 'current', 'aspire' ],
232                                                                                         xtype : 'SimpleStore',
233                                                                                         xns : Roo.data
234                                                                                     },
235                                                                                     '|xns' : 'Roo.bootstrap',
236                                                                                     xtype : 'Table',
237                                                                                     CellSelection : true,
238                                                                                     xns : Roo.bootstrap,
239                                                                                     RowSelection : true,
240                                                                                     cm : [
241                                                                                          {
242                                                                                                 '|xns' : 'Roo.grid',
243                                                                                                 header : 'Department',
244                                                                                                 dataIndex : 'display_name',
245                                                                                                 xtype : 'ColumnModel',
246                                                                                                 xns : Roo.grid
247                                                                                             },
248 {
249                                                                                                 '|xns' : 'Roo.grid',
250                                                                                                 header : 'Current',
251                                                                                                 dataIndex : 'current',
252                                                                                                 xtype : 'ColumnModel',
253                                                                                                 xns : Roo.grid,
254                                                                                                 renderer : function(v) {  
255                                                                                                 
256                                                                                                     var state = v> 0 ?  '-checked' : '';
257                                                                                                 
258                                                                                                     return v*1  > 0 ? 'X' : '-';             
259                                                                                                                 
260                                                                                                  }
261                                                                                             },
262 {
263                                                                                                 '|xns' : 'Roo.grid',
264                                                                                                 header : 'Aspire',
265                                                                                                 dataIndex : 'aspire',
266                                                                                                 xtype : 'ColumnModel',
267                                                                                                 xns : Roo.grid,
268                                                                                                 renderer : function(v) {  
269                                                                                                     var state = v> 0 ?  '-checked' : '';
270                                                                                                     return v*1  > 0 ? 'X' : '-';             
271                                                                                                  }
272                                                                                             }
273                                                                                     ],
274                                                                                     listeners : {
275                                                                                         cellclick : function (_self, el, rowIndex, columnIndex, e)
276                                                                                            {
277                                                                                                
278                                                                                            
279                                                                                                var cm = this.colModel.getColumnById(this.colModel.getColumnId(columnIndex));
280                                                                                                if (cm.dataIndex == 'current') {
281                                                                                                    var rec = _this.listTable.ds.getAt(rowIndex);
282                                                                                                    
283                                                                                                    rec.set('current', rec.data.current * 1 ? '0' : '1');
284                                                                                            
285                                                                                                    //_this.listTable.ds.fireEvent("datachanged", this);
286                                                                                                    rec.commit();
287                                                                                                    return;
288                                                                                                }
289                                                                                                  if (cm.dataIndex == 'aspire') {
290                                                                                                    var rec = _this.listTable.ds.getAt(rowIndex);
291                                                                                                    
292                                                                                                    rec.set('aspire', rec.data.aspire * 1 ? '0' : '1');
293                                                                                            
294                                                                                                    //_this.listTable.ds.fireEvent("datachanged", this);
295                                                                                                    rec.commit();
296                                                                                                    return;
297                                                                                                }
298                                                                                            
299                                                                                                 
300                                                                                            },
301                                                                                         render : function (_self)
302                                                                                            {
303                                                                                                 _this.listTable = _self;
304                                                                                                (function() { _self.store.load({}); }).defer(100)
305                                                                                            }
306                                                                                     },
307                                                                                     items : [
308
309                                                                                     ]
310
311                                                                                 }
312                                                                             ]
313
314                                                                         }
315                                                                     ]
316
317                                                                 },
318                                                                 {
319                                                                     '|xns' : 'Roo.bootstrap.dash',
320                                                                     xtype : 'TabPane',
321                                                                     xns : Roo.bootstrap.dash,
322                                                                     title : "tab 2",
323                                                                     items : [
324                                                                         {
325                                                                             '|xns' : 'Roo.bootstrap',
326                                                                             xtype : 'Column',
327                                                                             xns : Roo.bootstrap,
328                                                                             html : 'tab 2 content'
329                                                                         }
330                                                                     ]
331
332                                                                 }
333                                                             ]
334
335                                                         }
336                                                     ]
337
338                                                 },
339                                                 {
340                                                     '|xns' : 'Roo.bootstrap',
341                                                     md : 6,
342                                                     lg : 6,
343                                                     xtype : 'Column',
344                                                     xns : Roo.bootstrap,
345                                                     style : '',
346                                                     sm : 12,
347                                                     items : [
348                                                         {
349                                                             '|xns' : 'Roo.bootstrap',
350                                                             cls : 'nav-tabs-custom',
351                                                             xtype : 'Container',
352                                                             xns : Roo.bootstrap,
353                                                             items : [
354                                                                 {
355                                                                     '|xns' : 'Roo.bootstrap',
356                                                                     xtype : 'Header',
357                                                                     xns : Roo.bootstrap,
358                                                                     html : 'income',
359                                                                     style : 'margin: 10,10,0,0'
360                                                                 }
361                                                             ]
362
363                                                         }
364                                                     ]
365
366                                                 }
367                                             ]
368
369                                         },
370                                         {
371                                             '|xns' : 'Roo.bootstrap',
372                                             xtype : 'Row',
373                                             xns : Roo.bootstrap,
374                                             items : [
375                                                 {
376                                                     '|xns' : 'Roo.bootstrap',
377                                                     lg : 12,
378                                                     xtype : 'TabGroup',
379                                                     carousel : true,
380                                                     xns : Roo.bootstrap,
381                                                     navId : '#sample1',
382                                                     items : [
383                                                         {
384                                                             '|xns' : 'Roo.bootstrap',
385                                                             active : true,
386                                                             cls : 'item',
387                                                             xtype : 'TabPanel',
388                                                             xns : Roo.bootstrap,
389                                                             tabId : '#second',
390                                                             navId : '#sample1',
391                                                             listeners : {
392                                                                 render : function (_self)
393                                                                    {
394                                                                    _this.tab_second = _self;
395                                                                    }
396                                                             },
397                                                             items : [
398                                                                 {
399                                                                     '|xns' : 'Roo.bootstrap',
400                                                                     xtype : 'Header',
401                                                                     xns : Roo.bootstrap,
402                                                                     level : 3,
403                                                                     html : 'first tab'
404                                                                 },
405                                                                 {
406                                                                     '|xns' : 'Roo.bootstrap',
407                                                                     xtype : 'Container',
408                                                                     xns : Roo.bootstrap,
409                                                                     well : 'md',
410                                                                     style : 'padding-left:50px;padding-right:50px;',
411                                                                     items : [
412                                                                         {
413                                                                             '|xns' : 'Roo.bootstrap',
414                                                                             xtype : 'Row',
415                                                                             xns : Roo.bootstrap,
416                                                                             items : [
417                                                                                 {
418                                                                                     '|xns' : 'Roo.bootstrap',
419                                                                                     md : 6,
420                                                                                     xtype : 'Column',
421                                                                                     xns : Roo.bootstrap,
422                                                                                     items : [
423                                                                                         {
424                                                                                             '|xns' : 'Roo.bootstrap',
425                                                                                             labelAlign : 'top',
426                                                                                             fieldLabel : 'Some input',
427                                                                                             xtype : 'Input',
428                                                                                             allowBlank : true,
429                                                                                             xns : Roo.bootstrap,
430                                                                                             name : 'chosen_title'
431                                                                                         }
432                                                                                     ]
433
434                                                                                 }
435                                                                             ]
436
437                                                                         }
438                                                                     ]
439
440                                                                 }
441                                                             ]
442
443                                                         },
444                                                         {
445                                                             '|xns' : 'Roo.bootstrap',
446                                                             active : false,
447                                                             cls : 'item',
448                                                             xtype : 'TabPanel',
449                                                             xns : Roo.bootstrap,
450                                                             tabId : '#first',
451                                                             navId : '#sample1',
452                                                             listeners : {
453                                                                 render : function (_self)
454                                                                    {
455                                                                    _this.tab_first = _self;
456                                                                    }
457                                                             },
458                                                             items : [
459                                                                 {
460                                                                     '|xns' : 'Roo.bootstrap',
461                                                                     xtype : 'Header',
462                                                                     level : 3,
463                                                                     xns : Roo.bootstrap,
464                                                                     html : 'second tab'
465                                                                 },
466                                                                 {
467                                                                     '|xns' : 'Roo.bootstrap',
468                                                                     xtype : 'Container',
469                                                                     xns : Roo.bootstrap,
470                                                                     well : 'md',
471                                                                     style : 'padding-left:50px;padding-right:50px;',
472                                                                     items : [
473                                                                         {
474                                                                             '|xns' : 'Roo.bootstrap',
475                                                                             xtype : 'Row',
476                                                                             xns : Roo.bootstrap,
477                                                                             items : [
478                                                                                 {
479                                                                                     '|xns' : 'Roo.bootstrap',
480                                                                                     md : 6,
481                                                                                     xtype : 'Column',
482                                                                                     xns : Roo.bootstrap,
483                                                                                     items : [
484                                                                                         {
485                                                                                             '|xns' : 'Roo.bootstrap',
486                                                                                             labelAlign : 'top',
487                                                                                             fieldLabel : 'This is a label',
488                                                                                             xtype : 'Input',
489                                                                                             allowBlank : true,
490                                                                                             xns : Roo.bootstrap,
491                                                                                             name : 'chosen_title'
492                                                                                         }
493                                                                                     ]
494
495                                                                                 }
496                                                                             ]
497
498                                                                         }
499                                                                     ]
500
501                                                                 }
502                                                             ]
503
504                                                         },
505                                                         {
506                                                             '|xns' : 'Roo.bootstrap',
507                                                             cls : 'carousel-control left',
508                                                             preventDefault : true,
509                                                             xtype : 'Link',
510                                                             xns : Roo.bootstrap,
511                                                             html : '<span class=\"glyphicon glyphicon-chevron-left\"></span>',
512                                                             listeners : {
513                                                                 click : function (e)
514                                                                    {
515                                                                        _this.tabgroup.showPanelNext();
516                                                                    }
517                                                             }
518                                                         },
519                                                         {
520                                                             '|xns' : 'Roo.bootstrap',
521                                                             cls : 'carousel-control right',
522                                                             preventDefault : true,
523                                                             xtype : 'Link',
524                                                             xns : Roo.bootstrap,
525                                                             html : '<span class=\"glyphicon glyphicon-chevron-right\"></span>',
526                                                             listeners : {
527                                                                 click : function (e)
528                                                                    {
529                                                                          _this.tabgroup.showPanelNext();
530                                                                    }
531                                                             }
532                                                         }
533                                                     ]
534
535                                                 }
536                                             ]
537
538                                         }
539                                     ]
540
541                                 }
542                             ]
543
544                         }
545                     ]
546
547                 }
548             ]
549
550         };    }
551 });