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   
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 .table-body-fixed thead > tr,
66 .table-body-fixed tbody > tr
67 {}
68     display: block;
69     width: 1000px;
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: 400
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                     grid : {
209                         loadMask : true,
210                         striped : true,
211                         xns : Roo.bootstrap,
212                         xtype : 'Table',
213                         cls : 'table-fixed',
214                          store : {
215                             xns : Roo.data,
216                             xtype : 'Store',
217                          
218                             proxy : {
219                                 xns : Roo.data,
220                                 xtype : 'MemoryProxy',
221                                 data: [
222                                     ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
223                                     ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
224                                     ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
225                                     ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
226                                     ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
227                                     ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
228                                     ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
229                                     ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
230                                     ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
231                                     ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],
232                                     ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
233                                     ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
234                                     ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
235                                     ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
236                                     ['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],
237                                     ['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],
238                                     ['International Business Machines',81.41,0.44,0.54,'9/1 12:00am'],
239                                     ['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],
240                                     ['JP Morgan & Chase & Co',45.73,0.07,0.15,'9/1 12:00am'],
241                                     ['McDonald\'s Corporation',36.76,0.86,2.40,'9/1 12:00am'],
242                                     ['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],
243                                     ['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],
244                                     ['Pfizer Inc',27.96,0.4,1.45,'9/1 12:00am'],
245                                     ['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],
246                                     ['The Home Depot, Inc.',34.64,0.35,1.02,'9/1 12:00am'],
247                                     ['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],
248                                     ['United Technologies Corporation',63.26,0.55,0.88,'9/1 12:00am'],
249                                     ['Verizon Communications',35.57,0.39,1.11,'9/1 12:00am'],
250                                     ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am'],
251                                     ['Walt Disney Company (The) (Holding Company)',29.89,0.24,0.81,'9/1 12:00am']
252                                 ]
253                             },
254                             reader : {
255                            
256                                 xns : Roo.data,
257                                 xtype : 'ArrayReader',
258                                 fields: [
259                                     {name: 'company'},
260                                     {name: 'price', type: 'float'},
261                                     {name: 'change', type: 'float'},
262                                     {name: 'pctChange', type: 'float'},
263                                     {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
264                                 ]
265                             },
266                         },
267                         cm : [
268                             
269                             {
270                                 id:'company',
271                                 header: "Company",
272                                 width: 160,
273                                 sortable: true,
274                                 locked:false,
275                                 dataIndex: 'company',
276                                 xns : Roo.grid,
277                                 xtype : 'ColumnModel'
278                             },
279                             {
280                                 header: "Price",
281                                width: 160,
282                                 sortable: true,
283                                 renderer: Roo.util.Format.usMoney,
284                                 dataIndex: 'price',
285                                 xns : Roo.grid,
286                                 xtype : 'ColumnModel'
287                             }
288                             
289                         ]
290                         
291                     }
292                 
293                 },
294                 {
295                     xtype : 'Content',
296                     xns: Roo.bootstrap.panel,
297                     title : "Title Center",
298                     fitToFrame:true,
299                     closable:false,
300                     region : 'center',
301                     html : 'some body center'
302                     
303                 },
304                 
305                 {
306                     xtype : 'Nest',
307                     title : "Title Nest Center",
308                     
309                     xns: Roo.bootstrap.panel,
310                     region : 'center',
311                     
312                     layout : {
313                         xtype : 'Border',
314                         xns: Roo.bootstrap.layout,
315                         south: {
316                             xtype : 'Region',
317                             xns: Roo.bootstrap.layout,
318                                 split:true,
319                                 initialSize: 200,
320                                 minSize: 100,
321                                 maxSize: 400,
322                                 autoScroll:true,
323                                 collapsible:true,
324                                 titlebar: true
325                             },
326                             center: {
327                             xtype : 'Region',
328                             xns: Roo.bootstrap.layout,
329                                 autoScroll:true,
330                             },
331                         items : [
332                             {
333                                 xtype : 'Content',
334                                 xns: Roo.bootstrap.panel,
335                                 title : "More Info",
336                                 region : 'south',
337                                 html : 'some body south'
338                             },
339                             {
340                                 xtype : 'Content',
341                                 xns: Roo.bootstrap.panel,
342                                 title : "the body",
343                                 region : 'center',
344                                 html : 'some body center'
345                             },
346                         ]
347                     }
348                 
349                     
350                 }
351                  
352             ]   
353             
354         }
355     }
356 });
357   
358    Roo.onReady(function() {
359         Roo.XComponent.is_alt = true;
360           Roo.XComponent.build();
361           //dRoo.bootstrap.Tooltip.init();
362       });
363   
364         </script>
365 </head>
366 <body class="xtheme-gray">
367
368  </body>
369 </html>