examples/bootstrap/nested.html
[roojs1] / examples / bootstrap / nested.html
1 <!--
2
3 porting tst for layout classes from original roo library into bootstrap one.
4
5
6 -->
7 <html>
8 <head>
9   <title>Nested Layout</title>
10   
11    <!-- Bootstrap -->
12     <link rel="stylesheet" href="../../css-bootstrap/bootstrap.min.css">
13        
14     <link href="../../css-bootstrap/font-awesome.css" rel="stylesheet" type="text/css" />
15    
16     <link href="../../css-bootstrap/roojs-bootstrap-debug.css" rel="stylesheet" type="text/css" />
17     
18     <link href="../../../bootswatch/material-kit/css/material-kit.css" rel="stylesheet">
19
20     
21         
22     <script type="text/javascript" src="../../roojs-core-debug.js"></script>
23     <!-- bootstrap js.. needs to compile it later.. -->
24     <script type="text/javascript" src="../../roojs-bootstrap-debug.js"></script>
25
26   <script type="text/javascript" src="../../Roo/bootstrap/panel/Grid.js"></script>
27
28         <script type="text/javascript">
29
30 Roo.namespace("Dashboard");
31     </script>
32      
33          <script type="text/javascript" src="Dashboard.Header1.js"></script>
34
35      
36      
37      
38     <style type="text/css">
39 .navbar {
40     padding: 0;
41 }
42
43  
44 .table-body-fixed tbody {
45    overflow-y: scroll;
46   width: 100%;
47 }
48 .table-body-fixed  thead,
49 .table-body-fixed  tbody,
50 /*.table-body-fixed tr,
51 .table-body-fixed td, */
52 .table-body-fixed th   {
53   display: block;
54 }
55 .table-body-fixed thead {
56     overflow:  hidden;
57 }
58
59
60 .table-body-fixed tbody td, 
61 .table-body-fixed thead > tr> th {
62   float: left;
63   border-bottom-width: 0;
64 }
65 /* fake infinate widt.. */
66 .table-body-fixed thead > tr,
67 .table-body-fixed tbody > tr
68 {
69     display: block;
70     overflow: hidden;
71 }
72
73         </style>
74         <script type="text/javascript">
75
76 Roo.namespace("Example");
77
78 Example.Nested = new Roo.XComponent({
79     part     :  ["example", "nested" ],
80     order    : '001-Example-Nested',
81     region   : 'center',
82     parent   : false,
83     name     : "unnamed module",
84     disabled : false, 
85     permname : '', 
86     _tree : function()
87     {
88         var _this = this;
89         var MODULE = this;
90         return {
91             is_root : true,
92             xtype : 'Border',
93             xns : Roo.bootstrap.layout,
94             el : document.body, // border layout can be applied to the outer one...
95             west: {
96                 xtype : 'Region',
97                 xns: Roo.bootstrap.layout,
98                 split:true,
99                 tabPosition: 'top',
100                 initialSize: 400,
101                 titlebar: true,
102                // collapsible: true,
103                 minSize: 100,
104                 maxSize: 500
105             },
106             north: {
107                 xtype : 'Region',
108                 xns: Roo.bootstrap.layout,
109                 overflow : 'visible',
110                 
111                 initialSize: 50,
112                 titlebar: false
113                
114             },
115             center: {
116                 xtype : 'Region',
117                 xns: Roo.bootstrap.layout,
118                 autoScroll: false,
119                 tabPosition:'top',
120                  titlebar: true
121             },
122             items : [
123                 {
124                     xtype : 'Content',
125                     xns: Roo.bootstrap.panel,
126                     title : "Title west" ,
127                     fitToFrame:true,
128                     closable:false,
129                     region : 'north',
130                     items : [
131                         {
132                             bar : true,
133                             position : 'static-top',
134                             xtype : 'NavHeaderbar',
135                             tag : 'nav',
136                             xns : Roo.bootstrap,
137                             items : [
138                                 {
139                                     cls : 'navbar-btn sidebar-toggle',
140                                     xtype : 'Link',
141                                     xns : Roo.bootstrap,
142                                     html : '<span class=\"icon-bar\"></span><span class=\"icon-bar\"></span><span class=\"icon-bar\"></span>'
143                                 },
144                                 {
145                                     xtype : 'NavGroup',
146                                     align : 'right',
147                                     xns : Roo.bootstrap,
148                                     items : [
149                                         {
150                                             menu : {
151                                                 xtype : 'Menu',
152                                                 xns : Roo.bootstrap,
153                                                 items : [
154                                                     {
155                                                         xtype : 'MenuItem',
156                                                         xns : Roo.bootstrap,
157                                                         html : 'test'
158                                                     }
159                                                 ]
160         
161                                             },
162                                             xtype : 'NavItem',
163                                             xns : Roo.bootstrap,
164                                             html : 'test',
165                                             items : [
166         
167                                             ]
168         
169                                         },
170                                         {
171                                             xtype : 'NavItem',
172                                             xns : Roo.bootstrap,
173                                             html : 'test'
174                                         }
175                                     ]
176         
177                                 }
178                             ]
179         
180                         }
181                     ]
182                     
183                 },
184              
185                 {
186                     xtype : 'Content',
187                     xns: Roo.bootstrap.panel,
188                     title : "Title west" ,
189                     fitToFrame:true,
190                     closable:false,
191                     region : 'west',
192                     html : 'some body west'
193                     
194                 },
195                 {
196                     xtype : 'Grid',
197                     xns: Roo.bootstrap.panel,
198                     title : "Test Grid",
199                     fitToFrame:true,
200                     closable:false,
201                     region : 'west',
202                     listeners : {
203                             activate : function()
204                             {
205                                 this.grid.store.load.defer(100, this.grid.store);
206                             }
207                         },
208                     toolbar : {
209                         xtype: 'NavSimplebar',
210                         xns : Roo.bootstrap,
211                         items: [
212                             {
213                                 xtype: 'NavGroup',
214                                 xns: Roo.bootstrap,
215                                 items : [
216                                     {
217                                         xtype: 'NavItem',
218                                         xns: Roo.bootstrap,
219                                         html: 'a button'
220                                         
221                                     }
222                                 ]
223                             }
224                         ]
225                         
226                     },
227                     grid : {
228                         loadMask : true,
229                         striped : true,
230                         xns : Roo.bootstrap,
231                         xtype : 'Table',
232                         cls : 'table-fixed',
233                          store : {
234                             xns : Roo.data,
235                             xtype : 'Store',
236                          
237                             proxy : {
238                                 xns : Roo.data,
239                                 xtype : 'MemoryProxy',
240                                 data: [
241                                     ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
242                                     ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
243                                     ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
244                                     ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
245                                     ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
246                                     ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
247                                     ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
248                                     ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
249                                     ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
250                                     ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],
251                                     ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
252                                     ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
253                                     ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
254                                     ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
255                                     ['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],
256                                     ['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],
257                                     ['International Business Machines',81.41,0.44,0.54,'9/1 12:00am'],
258                                     ['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],
259                                     ['JP Morgan & Chase & Co',45.73,0.07,0.15,'9/1 12:00am'],
260                                     ['McDonald\'s Corporation',36.76,0.86,2.40,'9/1 12:00am'],
261                                     ['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],
262                                     ['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],
263                                     ['Pfizer Inc',27.96,0.4,1.45,'9/1 12:00am'],
264                                     ['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],
265                                     ['The Home Depot, Inc.',34.64,0.35,1.02,'9/1 12:00am'],
266                                     ['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],
267                                     ['United Technologies Corporation',63.26,0.55,0.88,'9/1 12:00am'],
268                                     ['Verizon Communications',35.57,0.39,1.11,'9/1 12:00am'],
269                                     ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am'],
270                                     ['Walt Disney Company (The) (Holding Company)',29.89,0.24,0.81,'9/1 12:00am']
271                                 ]
272                             },
273                             reader : {
274                            
275                                 xns : Roo.data,
276                                 xtype : 'ArrayReader',
277                                 fields: [
278                                     {name: 'company'},
279                                     {name: 'price', type: 'float'},
280                                     {name: 'change', type: 'float'},
281                                     {name: 'pctChange', type: 'float'},
282                                     {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
283                                 ]
284                             },
285                         },
286                         cm : [
287                             
288                             {
289                                 id:'company',
290                                 header: "Company",
291                                 width: 160,
292                                 sortable: true,
293                                 locked:false,
294                                 dataIndex: 'company',
295                                 xns : Roo.grid,
296                                 xtype : 'ColumnModel'
297                             },
298                             {
299                                 header: "Price",
300                                width: 160,
301                                 sortable: true,
302                                 renderer: Roo.util.Format.usMoney,
303                                 dataIndex: 'price',
304                                 xns : Roo.grid,
305                                 xtype : 'ColumnModel'
306                             }
307                             
308                         ]
309                         
310                     }
311                 
312                 },
313                 {
314                     xtype : 'Content',
315                     xns: Roo.bootstrap.panel,
316                     title : "Title Center",
317                     fitToFrame:true,
318                     closable:false,
319                     region : 'center',
320                     html : 'some body center'
321                     
322                 },
323                 
324                 {
325                     xtype : 'Nest',
326                     title : "Title Nest Center",
327                     
328                     xns: Roo.bootstrap.panel,
329                     region : 'center',
330                     
331                     layout : {
332                         xtype : 'Border',
333                         xns: Roo.bootstrap.layout,
334                         south: {
335                             xtype : 'Region',
336                             xns: Roo.bootstrap.layout,
337                                 split:true,
338                                 initialSize: 200,
339                                 minSize: 100,
340                                 maxSize: 400,
341                                 autoScroll:true,
342                                 collapsible:true,
343                                 titlebar: true
344                             },
345                             center: {
346                             xtype : 'Region',
347                             xns: Roo.bootstrap.layout,
348                                 autoScroll:true,
349                             },
350                         items : [
351                             {
352                                 xtype : 'Content',
353                                 xns: Roo.bootstrap.panel,
354                                 title : "More Info",
355                                 region : 'south',
356                                 html : 'some body south'
357                             },
358                             {
359                                 xtype : 'Content',
360                                 xns: Roo.bootstrap.panel,
361                                 title : "the body",
362                                 region : 'center',
363                                 html : 'some body center'
364                             },
365                         ]
366                     }
367                 
368                     
369                 }
370                  
371             ]   
372             
373         }
374     }
375 });
376   
377    Roo.onReady(function() {
378         Roo.XComponent.is_alt = true;
379           Roo.XComponent.build();
380           //dRoo.bootstrap.Tooltip.init();
381       });
382   
383         </script>
384 </head>
385 <body class="xtheme-gray">
386
387  </body>
388 </html>