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