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