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