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