Debian Codegraph @

dijit/tests/layout/test_SplitContainer.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html lang="en">
4 <head>
5 <title>SplitContainer Widget Demo</title>
6
7 <style type="text/css">
8 @import "../../themes/claro/document.css";
9 @import "../css/dijitTests.css";
10 .dojoContentPane {
11 padding:1em;
12 }
13 </style>
14
15 <!-- required: the default dijit theme: -->
16 <link id="themeStyles" rel="stylesheet" href="../../../dijit/themes/claro/claro.css"/>
17
18 <!-- required: dojo.js -->
19 <script type="text/javascript" src="../../../dojo/dojo.js"
20 djConfig="isDebug: true, parseOnLoad: true"></script>
21
22 <!-- only needed for alternate theme testing: do NOT use in your code! -->
23 <script type="text/javascript" src="../_testCommon.js"></script>
24
25 <script type="text/javascript">
26 dojo.require("dijit.dijit"); // optimize: load dijit layer
27 dojo.require("dijit.layout.SplitContainer");
28 dojo.require("dijit.layout.ContentPane");
29
30 // these exist inside our href splitcontainer
31 dojo.require("dijit.form.Button");
32 dojo.require("dijit.form.ComboBox");
33 var programaticExample = function(){
34
35 var rootNode = dojo.byId("holderNode");
36 // add two children
37 var pane1 = rootNode.appendChild(document.createElement('div'));
38 var pane2 = rootNode.appendChild(document.createElement('div'));
39 var pane3 = rootNode.appendChild(document.createElement('div'));
40
41 // set the content. can use xhrGet, also
42 pane1.innerHTML = "Pane one test"; pane2.innerHTML = "Pane two test";
43
44 // should use css, but this works:
45 dojo.style(rootNode,"height","150px");
46 dojo.style(rootNode,"border","1px solid #333");
47
48 // make them contentpanes
49 var cp1 = new dijit.layout.ContentPane({ sizeShare:20 },pane1);
50 var cp2 = new dijit.layout.ContentPane({ sizeShare:30 },pane2);
51 var cp3 = new dijit.layout.ContentPane({
52 href: "doc0.html",
53 sizeShare:30
54 },pane3).startup();
55
56 // init the splitcontainer
57 var split = new dijit.layout.SplitContainer({
58 orientation:"horizontal",
59 sizerWidth:7
60 },rootNode).startup();
61
62 };
63 dojo.ready(programaticExample);
64
65 // for testing SplitContainer.addChild()
66 ctr = 1;
67 function addChild(parentId, position){
68 dijit.byId(parentId).addChild(new dijit.layout.ContentPane({
69 id: "ContentPane" + ctr,
70 innerHTML: "added child #" + ctr++
71 }), position);
72 }
73 </script>
74 </head>
75 <body role="main">
76 <h1 class="testTitle">Dijit Split Container Test - DEPRECATED!</h1>
77 <p><strong>dijit.layout.SplitContainer is deprecated use
78 BorderContainer with splitter instead -- will be removed in version: 2</strong></p>
79 <p>HTML before</p>
80
81 <div dojoType="dijit.layout.SplitContainer"
82 id="split1"
83 orientation="vertical"
84 sizerWidth="7"
85 activeSizing="false"
86 style="border: 1px solid #bfbfbf; width: 400px; height: 300px;"
87 >
88 <div dojoType="dijit.layout.ContentPane" sizeMin="10" sizeShare="50">
89 this box has three split panes
90 </div>
91 <div dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="50"
92 style="background-color: yellow; border: 3px solid purple;">
93 in vertical mode
94 </div>
95 <div dojoType="dijit.layout.ContentPane" sizeMin="10" sizeShare="50">
96 without active resizing
97 </div>
98 </div>
99 <button onclick="addChild('split1');">add child at end</button>
100 <button onclick="addChild('split1', 'first');">add child at beginning</button>
101 <button onclick="addChild('split1', 3);">addChild(child, 3)</button>
102 <button onclick="addChild('split1', dijit.byId('split1').getChildren().length-1);">addChild(child, getChildren().length-1)</button>
103 <br><br>
104
105 <div dojoType="dijit.layout.SplitContainer"
106 orientation="horizontal"
107 sizerWidth="7"
108 activeSizing="true"
109 style="border: 1px solid #bfbfbf; float: left; width: 400px; height: 300px;">
110 <div dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="20">
111 this box has two horizontal panes
112 </div>
113 <div dojoType="dijit.layout.ContentPane" sizeMin="50" sizeShare="50">
114 with active resizing, a smaller sizer, different starting sizes and minimum sizes
115 </div>
116 </div>
117
118 <p style="clear: both;">HTML after</p>
119
120 the following splitter contains two iframes, see whether the resizer works ok in this situation
121 <div dojoType="dijit.layout.SplitContainer"
122 orientation="horizontal"
123 sizerWidth="5"
124 activeSizing="false"
125 style="border: 2px solid black; float: left; width: 100%; height: 300px;"
126 >
127 <div dojoType="dijit.layout.ContentPane" sizeMin="20" sizeShare="20">
128 <iframe style="width: 100%; height: 100%" title="iframe"></iframe>
129 </div>
130 <div dojoType="dijit.layout.ContentPane" sizeMin="50" sizeShare="50">
131 <iframe style="width: 100%; height: 100%" title="iframe2"></iframe>
132 </div>
133 </div>
134
135 <h3>Programatic Example:</h3>
136 <div id="holderNode"></div>
137
138 </body>
139 </html>