examples/bootstrap4/nested.html
[roojs1] / examples / bootstrap4 / 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 href="../../css-bootstrap4/bootstrap.min.css" rel="stylesheet" type="text/css" />   
13     <link href="../../css-bootstrap4/font-awesome.css" rel="stylesheet" type="text/css" />
14     <link href="../../css-bootstrap4/roojs-bootstrap-debug.css" rel="stylesheet" type="text/css" />
15     
16   <!--  <link href="../../../bootswatch/material-kit/css/material-kit.css" rel="stylesheet"> -->
17
18     
19         
20     <script type="text/javascript" src="../../roojs-core-debug.js"></script>
21     <!-- bootstrap js.. needs to compile it later.. -->
22     <script type="text/javascript" src="../../roojs-bootstrap-debug.js"></script>
23     
24   
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 <script type="text/javascript" src="./nested-dialog.js"></script>
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                                             listeners : {
163                                                 click : function()
164                                                 {
165                                                     Example.NestedDialog.show({});
166                                                 }
167                                             },
168                                             html : 'test dialog',
169                                             items : [
170         
171                                             ]
172         
173                                         },
174                                         {
175                                             xtype : 'NavItem',
176                                             xns : Roo.bootstrap,
177                                             html : 'test'
178                                         }
179                                     ]
180         
181                                 }
182                             ]
183         
184                         }
185                     ]
186                     
187                 },
188              
189                 {
190                     xtype : 'Content',
191                     xns: Roo.bootstrap.panel,
192                     title : "Title west" ,
193                     fitToFrame:true,
194                     closable:false,
195                     region : 'west',
196                     html : 'some body west'
197                     
198                 },
199                 {
200                     xtype : 'Grid',
201                     xns: Roo.bootstrap.panel,
202                     title : "Test Grid",
203                     fitToFrame:true,
204                     closable:false,
205                     region : 'west',
206                     listeners : {
207                             activate : function()
208                             {
209                                 this.grid.store.load.defer(100, this.grid.store);
210                             }
211                         },
212                     toolbar : {
213                         xtype: 'NavSimplebar',
214                         xns : Roo.bootstrap,
215                         items: [
216                             {
217                                 xtype: 'NavGroup',
218                                 xns: Roo.bootstrap,
219                                 items : [
220                                     {
221                                         xtype: 'NavItem',
222                                         xns: Roo.bootstrap,
223                                         html: 'a button'
224                                         
225                                     },
226                                     {
227                                         xtype: 'Input',
228                                         xns: Roo.bootstrap,
229                                         placeholder: 'a text input'
230                                         
231                                     }
232                                 ]
233                             }
234                         ]
235                         
236                     },
237                     grid : {
238                         loadMask : true,
239                         striped : true,
240                         xns : Roo.bootstrap,
241                         xtype : 'Table',
242                         cls : 'table-fixed',
243                         rowSelection : true,
244                         footer : {
245                             xtype : 'PagingToolbar',
246                             pageSize : 25,
247                             xns : Roo.bootstrap,
248                             '|xns' : 'Roo.bootstrap'
249                         },
250                         store : {
251                             xns : Roo.data,
252                             xtype : 'Store',
253                          
254                             proxy : {
255                                 xns : Roo.data,
256                                 xtype : 'MemoryProxy',
257                                 data: [
258                                     ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
259                                     ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
260                                     ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
261                                     ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
262                                     ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
263                                     ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
264                                     ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
265                                     ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
266                                     ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
267                                     ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],
268                                     ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],
269                                     ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],
270                                     ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],
271                                     ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'] 
272                                 ]
273                             },
274                             reader : {
275                            
276                                 xns : Roo.data,
277                                 xtype : 'ArrayReader',
278                                 fields: [
279                                     {name: 'company'},
280                                     {name: 'price', type: 'float'},
281                                     {name: 'change', type: 'float'},
282                                     {name: 'pctChange', type: 'float'},
283                                     {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
284                                 ]
285                             },
286                         },
287                         cm : [
288                             
289                             {
290                                 id:'company',
291                                 header: "Company",
292                                 width: 160,
293                                 sortable: true,
294                                 locked:false,
295                                 dataIndex: 'company',
296                                 xns : Roo.grid,
297                                 xtype : 'ColumnModel'
298                             },
299                             {
300                                 header: "Price",
301                                width: 160,
302                                 sortable: true,
303                                 renderer: Roo.util.Format.usMoney,
304                                 dataIndex: 'price',
305                                 xns : Roo.grid,
306                                 xtype : 'ColumnModel'
307                             }
308                             
309                         ]
310                         
311                     }
312                 
313                 },
314                 {
315                     xtype : 'Content',
316                     xns: Roo.bootstrap.panel,
317                     title : "Title Center",
318                     fitToFrame:true,
319                     closable:false,
320                     region : 'center',
321                     html : 'some body center'
322                     
323                 },
324                 
325                 {
326                     xtype : 'Nest',
327                     title : "Title Nest Center",
328                     
329                     xns: Roo.bootstrap.panel,
330                     region : 'center',
331                     
332                     layout : {
333                         xtype : 'Border',
334                         xns: Roo.bootstrap.layout,
335                         south: {
336                             xtype : 'Region',
337                             xns: Roo.bootstrap.layout,
338                                 split:true,
339                                 initialSize: 200,
340                                 minSize: 100,
341                                 maxSize: 400,
342                                 autoScroll:true,
343                                 collapsible:true,
344                                 titlebar: true
345                             },
346                             center: {
347                             xtype : 'Region',
348                             xns: Roo.bootstrap.layout,
349                                 autoScroll:true,
350                             },
351                         items : [
352                             {
353                                 xtype : 'Content',
354                                 xns: Roo.bootstrap.panel,
355                                 title : "More Info",
356                                 region : 'south',
357                                 html : 'some body south'
358                             },
359                             {
360                                 xtype : 'Content',
361                                 xns: Roo.bootstrap.panel,
362                                 title : "the body",
363                                 region : 'center',
364                                 html : 'some body center'
365                             },
366                         ]
367                     }
368                 
369                     
370                 }
371                  
372             ]   
373             
374         }
375     }
376 });
377   
378    Roo.onReady(function() {
379         Roo.XComponent.is_alt = true;
380           Roo.XComponent.build();
381           //dRoo.bootstrap.Tooltip.init();
382       });
383   
384         </script>
385 </head>
386 <body class="xtheme-gray">
387
388  </body>
389 </html>