1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
| <!DOCTYPE html>
| <html>
| <head>
| <meta charset="utf-8">
| <title>Test Mixed Dijit Layout</title>
| <meta name="viewport" content="width=570">
| <style>
| @import "../../dijit/themes/claro/document.css";
| @import "../css/dgrid.css";
| @import "../../dijit/themes/claro/claro.css";
| @import "../css/skins/claro.css";
| html, body {
| padding: 0;
| margin: 0;
| height: 100%;
| overflow: hidden;
| }
| #appLayout {
| height: 100%;
| }
| #grid1, #grid2 {
| height:95%;
| }
| </style>
| <script src="../../dojo/dojo.js"
| data-dojo-config="async: true"></script>
| <script>
| require(["dgrid/OnDemandGrid",
| "dgrid/Selection",
| "dgrid/extensions/DijitRegistry",
| "dijit/registry",
| "dojo/_base/lang",
| "dojo/_base/declare",
| "dijit/layout/BorderContainer",
| "dijit/layout/TabContainer",
| "dojo/parser",
| "dgrid/test/data/testStore",
| "dijit/layout/ContentPane",
| "dojo/domReady!"
| ], function(Grid, Selection, DijitRegistry, registry, lang, declare, BC, TC, parser, testStore){
| var
| gridCols = window.gridCols = {
| col1: "Column 1",
| col2: {name: "Column 2", sortable: false},
| col3: "Column 3",
| col4: "Column 4"
| },
| CustomGrid = declare([Grid, Selection, DijitRegistry]),
| grid1,
| grid2;
|
| parser.parse();
|
| // Add grids to TabContainer parsed within page
| grid1 = window.grid1 = new CustomGrid({
| id: "grid1",
| collection: testStore,
| columns: lang.clone(gridCols),
| selectionMode: "single",
| title: "Tab 1"
| });
| registry.byId("tc").addChild(grid1);
|
| grid2 = window.grid2 = new CustomGrid({
| id: "grid2",
| collection: testStore,
| columns: lang.clone(gridCols),
| selectionMode: "single",
| title: "Tab 2"
| });
| registry.byId("tc").addChild(grid2);
| });
| </script>
| </head>
| <body class="claro">
| <div id="appLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline'">
| <div class="centerPanel" data-dojo-type="dijit.layout.TabContainer" id="tc"
| data-dojo-props="region: 'center', tabPosition: 'top'">
| </div>
| <div class="edgePanel" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region: 'top'">
| Test dijit mixed layout - programmatic dgrid in declarative layout
| </div>
| </div>
| </body>
| </html>
|
|