-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
194 lines (178 loc) · 6.59 KB
/
test.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid-bootstrap.css" />
<meta charset="utf-8" />
<title>MaskAuction Server</title>
<script>
$.jgrid.defaults.width = 1500;
$.jgrid.defaults.responsive = true;
$.jgrid.defaults.styleUI = 'Bootstrap';
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<div style="margin-left:100px;margin-top:50px">
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#jqGrid").jqGrid({
url: 'http://localhost:80/dashboard/test.php',
// we set the changes to be made at client side using predefined word clientArray
addURL: 'http://localhost:80/dashboard/insertData.php',
editURL: 'http://localhost:80/dashboard/insertData.php',
datatype: "json",
jsonReader: {
root: 'lineitems',
},
colNames : [ 'id','startdate','enddate','pacing','fcap' ,'price','goal', 'type','creative_Id','creative_type','device','os','ig', 'adm'],
colModel: [
{
label: 'ID',
name: 'id',
width: 90,
key: true,
editable: true,
},
{
label: 'StartDate',
name: 'startdate',
width: 210,
key: true,
editable: true,
},
{
label: 'EndDate',
name: 'enddate',
width: 210,
key: true,
editable: true,
},
{
label: 'Pacing',
name: 'pacing',
width: 100,
editable: true // must set editable to true if you want to make the field editable
},
{
label: 'FCAP',
name: 'fcap',
width: 90,
editable: true // must set editable to true if you want to make the field editable
},
{
label: 'Price',
name: 'price',
width: 90,
key: true,
editable: true,
},
{
label: 'GOAL',
name: 'goal',
width: 75,
key: true,
editable: true,
},
{
label: 'Type',
name: 'type',
width: 75,
key: true,
editable: true,
},
{
label: 'CreativeID',
name: 'creative_Id',
width: 150,
key: true,
editable: true,
},
{
label: 'Creative Type',
name: 'creative_type',
width: 200,
key: true,
editable: true,
},
{
label: 'device',
name: 'device',
width: 150,
key: true,
editable: true,
},
{
label: 'os',
name: 'os',
width: 150,
key: true,
editable: true,
},
{
label: 'ig',
name: 'ig',
width: 90,
key: true,
editable: true,
}, {
label: 'ADM',
name: 'adm',
width: 300,
key: true,
editable: true,
}
],
sortname: 'id',
sortorder : 'asc',
loadonce: true,
viewrecords: true,
height: 200,
rowNum: 10,
pager: "#jqGridPager"
});
$('#jqGrid').navGrid('#jqGridPager',
// the buttons to appear on the toolbar of the grid
{ edit: false, add: true, del: false, search: false, refresh: true, view: false, position: "left", cloneToTop: false },
// options for the Edit Dialog
{
editCaption: "The Edit Dialog",
recreateForm: true,
checkOnUpdate : true,
checkOnSubmit : true,
closeAfterEdit: true,
errorTextFormat: function (data) {
return 'Error: ' + data.responseText
}
},
// options for the Add Dialog
{
url: 'http://localhost:80/dashboard/insertData.php',
closeAfterAdd: true,
recreateForm: true,
errorTextFormat: function (data) {
return 'Error: ' + data.responseText
}
},
// options for the Delete Dailog
{
errorTextFormat: function (data) {
return 'Error: ' + data.responseText
}
},
// options for the Search Dailog
{
errorTextFormat: function (data) {
return 'Error: ' + data.responseText
}
});
});
</script>
</body>
</html>