-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
169 lines (160 loc) · 5 KB
/
index.html
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html>
<head>
<title>Test dijit programmatic layout</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
@import "dojo/resources/dojo.css";
@import "dijit/themes/claro/document.css";
@import "dijit/themes/claro/claro.css";
@import "dgrid/css/dgrid.css";
@import "dgrid/css/skins/claro.css";
html, body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
overflow:hidden;
}
.dijitBorderContainer .dgrid {
height: 100%;
}
</style>
<script type="text/javascript">
var dojoConfig = {
async : true,
parseOnLoad : true
}
</script>
<script type="text/javascript" src="dojo/dojo.js"></script>
<script type="text/javascript">
require(["dojo/ready", "dojo/parser", "dojo/dom-construct", "test/TopBC"], function(ready, parser, domConstruct, BC){
ready(function(){
var pBC = new BC({}, "bc");
pBC.startup();
});
});
</script>
</head>
<body class="claro">
<div id="bc"></div>
</body>
</html>
testDgrid.js
define(
[
'dojo/_base/declare',
'dgrid/OnDemandGrid',
'dojo/html',
'dgrid/Selection',
'dgrid/extensions/DijitRegistry'
],
function(declare, GridBase, html, DgridSelection, DijitRegistry)
{
var pGrid = declare([GridBase, DgridSelection, DijitRegistry],
{
columns:
{
name: {
field: 'Name',
label: 'Name',
renderCell: function(item, value, node, options)
{
value = item.Name;
html.set(node, value);
return value;
}
},
value: {
field: '_Value',
label: 'Simple Value',
},
namespaceName: {
field: 'NamespaceName',
label: 'Namespace Name',
},
type: {
field: 'Type',
label: 'Type',
}
},
constructor:function (args)
{
// Call Super
dojo.safeMixin(this, args);
},
postCreate:function (args)
{
this.inherited(arguments);
this.renderArray([
{Name: "test row 1", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 2", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 3", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 4", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 5", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 6", _Value: "under value", NamespaceName: "nsn", Type: "test row"},
{Name: "test row 7", _Value: "under value", NamespaceName: "nsn", Type: "test row"}
]);
this.on("dgrid-select", dojo.hitch(this, function(event){
// get the rows that were just selected
var rows = event.rows;
for(var row in rows)
{
console.log(rows[row].data);
}
}));
this.on(".dgrid-row:contextmenu", dojo.hitch(this, function(evt){
evt.preventDefault(); // prevent default browser context menu
// create or popup a menu here
console.log(this.row(evt).data);
}));
}
});
return pGrid;
}
);
testTopBC.js
define(
[
'dojo/_base/declare',
'dijit/layout/BorderContainer',
'dijit/layout/TabContainer',
'dijit/layout/ContentPane',
'test/Dgrid'
],
function(declare, BC, TC, CP, Dgrid)
{
return declare([BC],
{
design:"sidebar",
gutters:"true",
liveSplitters:"true",
style:"width: 100%; height: 100%;",
constructor:function (args)
{
// Call Super
dojo.safeMixin(this, args);
},
postCreate:function (args)
{
var pPane = new CP({
region: "center",
style: "height:40%; width:50%",
splitter: "false"
});
this.addChild(pPane);
// WILL ERROR HERE
var pDgrid = new Dgrid({
}, pPane.domNode);
var pTC = new TC({
region: "bottom",
style: "height:60%; width:100%",
splitter: "false"
});
this.addChild(pTC);
pTC.addChild(new CP({title: 'Tab 1', content: 'page 1 content'}));
pTC.addChild(new CP({title: 'Tab 2', content: 'page 2 content'}));
}
});
}
);