Debian Codegraph @

dojox/layout/tests/test_GridContainer_in_BorderContainer_prog.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <title>Demo GridContainer</title>
7 <style type="text/css" title="text/css">
8 /* <![CDATA[ */
9 @import "../../../dojo/resources/dojo.css";
10 @import "../../../dijit/themes/soria/soria.css";
11
12 html,body{
13 overflow:hidden;
14 margin:0; padding:0;
15 width:100%; height:100%;
16 }
17
18 .cpane{
19 border:1px solid #666;
20 font:bold 12px Arial;
21 color:#999;
22 background:#FFF;
23 padding:10px;
24 height:50px;
25 }
26
27 #GC1{
28 margin:0;
29 padding:5px;
30 overflow-x:hidden;
31 overflow-y:scroll;
32 }
33 #GC1 .gridContainerTable {
34 border-collapse:collapse;
35 }
36
37 #GC1 .gridContainerZone {
38 border : 2px solid #ededed
39 }
40
41 .dj_ie6 .dropIndicator, .dj_ie6 .dijitContentPane, .dj_ie6 .dijitCalendar{
42 margin: 5px;
43 }
44 .gridContainerZone > *{
45 margin: 5px !important;
46 }
47
48 /* ]]> */
49 </style>
50
51 <link rel="stylesheet" href="../resources/GridContainer.css">
52 <link rel="stylesheet" href="../resources/ExpandoPane.css">
53
54 <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true"></script>
55
56 <script type="text/javascript">
57 dojo.require("dojo.parser");
58 dojo.require("dijit.TitlePane");
59 dojo.require("dijit.layout.ContentPane");
60 dojo.require("dojox.layout.GridContainer");
61 dojo.require("dojox.layout.ExpandoPane");
62 dojo.require("dijit.layout.BorderContainer");
63 dojo.require("dijit.layout.AccordionContainer");
64 dojo.require("dijit.form.Button");
65 dojo.require("dijit.Calendar");
66 dojo.require("dojo.fx.easing");
67
68 dojo.addOnLoad(init);
69 function init(){
70 // Create the border container
71 bc = new dijit.layout.BorderContainer({liveSplitters:false, style:{height: '100%', width: '100%'}});
72 document.body.appendChild(bc.domNode);
73
74 // Create the ExpandoPane to be placed on the left hand side
75 ep = new dojox.layout.ExpandoPane({
76 title: 'Left Side',
77 splitter:true,
78 style:{
79 width:'200px'
80 },
81 region: 'left',
82 easing: dojo.fx.easing.backOut,
83 duration: 600
84 });
85 bc.addChild(ep);
86
87 // Create the GridContainer to be placed on the left hand side.
88 // You cna drag TitlePanes, AccordionContainers and Calendar widgets into it
89 gc1 = new dojox.layout.GridContainer({
90 acceptTypes: ['TitlePane', 'AccordionContainer', 'Calendar'],
91 hasResizableColumns:false,
92 nbZones:1,
93 style:{
94 height: '100%'
95 }
96 });
97 ep.containerNode.appendChild(gc1.domNode);
98
99 // Add three TitlePane widgets. Note that the 'dndType' attributes are the same
100 // as those in the 'acceptTypes' attribute of the GridContainer.
101 // These do NOT have to match to the widget type name
102 tp1 = new dijit.TitlePane({
103 attachParent:true,
104 title:'Panel 1',
105 dndType:'TitlePane'
106 });
107 tp1.set('content', 'lorem ipsum');
108 gc1.addChild(tp1);
109
110 tp2 = new dijit.TitlePane({
111 title:'Panel 2',
112 dndType:'TitlePane'
113 });
114 tp2.set('content', 'lorem ipsum');
115 gc1.addChild(tp2);
116
117 tp3 = new dijit.TitlePane({
118 title:'Panel 3',
119 dndType:'TitlePane'
120 });
121 tp3.set('content', 'lorem ipsum');
122 gc1.addChild(tp3,0,2);
123
124 // Create the central GridContainer
125 gc2 = new dojox.layout.GridContainer({
126 id:'GC1',
127 region: 'center',
128 nbZones:3,
129 hasResizableColumns:false,
130 acceptTypes:['ContentPane', 'TitlePane', 'Calendar', 'AccordionPane']
131 });
132 bc.addChild(gc2);
133
134 cp1 = new dijit.layout.ContentPane({
135 "class":'cpane',
136 label:'Content Pane',
137 dndType:'ContentPane'
138 });
139 cp1.set('content', 'ContentPane n*1 !');
140 gc2.addChild(cp1);
141
142 tp4 = new dijit.TitlePane({
143 title:'Ergo',
144 dndType:'TitlePane'
145 });
146 tp4.set('content', 'Non ergo erunt homines deliciis diffluentes audiendi, si quando de amicitia, quam nec usu nec ratione habent cognitam, disputabunt. Nam quis est, pro deorum fidem atque hominum! qui velit, ut neque diligat quemquam nec ipse ab ullo diligatur, circumfluere omnibus copiis atque in omnium rerum abundantia vivere? Haec enim est tyrannorum vita nimirum, in qua nulla fides, nulla caritas, nulla stabilis benevolentiae potest esse fiducia, omnia semper suspecta atque sollicita, nullus locus amicitiae.');
147 gc2.addChild(tp4,0,1);
148
149 cp2 = new dijit.layout.ContentPane({
150 "class":'cpane',
151 label:"Content Pane",
152 dndType:'ContentPane'
153 });
154 cp2.set('content', 'Content Pane n*2 !');
155 gc2.addChild(cp2,1,0);
156
157 cp3 = new dijit.layout.ContentPane({
158 title:"Itellectum",
159 dndType:'ContentPane'
160 });
161 cp3.set('content', 'Intellectum est enim mihi quidem in multis, et maxime in me ipso, sed paulo ante in omnibus, cum M. Marcellum senatui reique publicae concessisti, commemoratis praesertim offensionibus, te auctoritatem huius ordinis dignitatemque rei publicae tuis vel doloribus vel suspicionibus anteferre. Ille quidem fructum omnis ante actae vitae hodierno die maximum cepit, cum summo consensu senatus, tum iudicio tuo gravissimo et maximo. Ex quo profecto intellegis quanta in dato beneficio sit laus, cum in accepto sit tanta gloria.');
162 gc2.addChild(cp3,1,1);
163
164 cp4 = new dijit.layout.ContentPane({
165 "class":'cpane',
166 label:'Content Pane',
167 dndType:'ContentPane'
168 });
169 cp4.set('content', 'Content Pane n*3 !');
170 gc2.addChild(cp4,1,2);
171
172 cp5 = new dijit.layout.ContentPane({
173 "class":'cpane',
174 label:'Content Pane',
175 dndType:'ContentPane'
176 });
177 cp5.set('content', 'Content Pane n*4 !');
178 gc2.addChild(cp5,2,0);
179
180 dp = new dijit.Calendar({dndType:'Calendar'});
181 gc2.addChild(dp,2,1);
182
183 // Add the grid container on the right hand side. Only TitlePanes can be dragged into it.
184 gc3 = new dojox.layout.GridContainer({
185 region: 'right',
186 nbZones:1,
187 hasResizableColumns:false,
188 acceptTypes:['TitlePane'],
189 style: {width:'200px'},
190 splitter:true});
191 bc.addChild(gc3);
192
193 tp4 = new dijit.TitlePane({
194 attachParent:true,
195 title:'Panel 1',
196 dndType:'TitlePane'
197 });
198 tp4.set('content', 'lorem ipsum');
199 gc3.addChild(tp4,0,0);
200
201 tp5 = new dijit.TitlePane({
202 title:'Panel 2',
203 dndType:'TitlePane'
204 });
205 tp5.set('content', 'lorem ipsum');
206 gc3.addChild(tp5,0,1);
207
208 tp6 = new dijit.TitlePane({
209 title:'Panel 3',
210 dndType:'TitlePane'
211 });
212 tp6.set('content', 'lorem ipsum');
213 gc3.addChild(tp6,0,2);
214
215 gc1.startup();
216 bc.startup();
217 }
218
219 </script>
220
221 </head>
222
223 <body class="soria">
224 <div style="width:200px;height:200px;background-color: #aaa;cursor:pointer;"
225 id="deleteThis"
226 onclick="dojo.destroy(dojo.byId('deleteThis'))">
227 Test dragging elements in the GridContainer.
228 Then click To Delete Me Then try to drag elements in the GridContainer again
229 </div>
230 </body>
231 </html>