-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid_generator.html
125 lines (109 loc) · 3.45 KB
/
grid_generator.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
<html>
<head>
<script type="text/javascript" src="scripts/jquery-1.7.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<script type="text/javascript" src="scripts/grid.js"></script>
<title>JS_Grid Generator: By Nikhil Baliga</title>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
#js_grid_gen_header, #js_grid_gen_detail {
height: 500px;
}
</style>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">JS_Grid Generator</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Tutorial</a></li>
<li class="divider-vertical"></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div id='js_grid_gen_header'></div>
<div id='js_grid_gen_detail'></div>
</div>
<script type="text/javascript">
// Some constants that can be used for both sections
var source_true_false = {true: "True", false: "False"};
// Elements for the header section
var source_container = {table: "Table", form: "Form", chart: "Chart"};
var label_header = {id: "Grid ID",
container_type: "Container",
addVisible: "Add Btn",
onAdd: "On Add",
deleteVisible: "Delete Btn",
onDelete: "On Delete",
saveVisible: "Save Btn",
onSave: "On Save",
searchVisible: "Search Btn",
onSearch: "On Search",
exportVisible: "Export Btn",
qbeEnabled: "QBE"
};
var element_type_header = {id: {type: "text"},
container_type: {type: "select", source: source_container},
addVisible: {type: "select", source: source_true_false},
onAdd: {type: "text"},
deleteVisible: {type: "select", source: source_true_false},
onDelete: {type: "text"},
saveVisible: {type: "select", source: source_true_false},
onSave: {type: "text"},
searchVisible: {type: "select", source: source_true_false},
onSearch: {type: "text"},
exportVisible: {type: "select", source: source_true_false},
qbeEnabled: {type: "select", source: source_true_false},
};
// Elements for the detail section
var label_detail = {key_name: "Key",
label_name: "Label",
element_type: "Type",
source: "Source",
qbeEnabled: "QBE",
summable: "Summable"
};
var element_type_detail = {key_name: {type: "text"},
label_name: {type: "text"},
element_type: {type: "select", source: source_true_false},
source: {type: "text"},
qbeEnabled: {type: "select", source: source_true_false},
summable: {type: "select", source: source_true_false}
};
var data = null;
// Render the header section
renderGrid({
"id": "js_grid_gen_header",
"label": label_header,
"data": data,
"element_type": element_type_header,
"qbeEnabled": "false",
"container": "form"
});
// Render the detail section
renderGrid({
"id": "js_grid_gen_detail",
"label": label_detail,
"data": data,
"element_type": element_type_detail,
"qbeEnabled": "false",
"container": "table"
});
</script>
</body>
</html>