-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserList.html
178 lines (153 loc) · 6.14 KB
/
userList.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
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Kullanıcı Listesi</title>
<meta charset="UTF-8">
<style>
body {
margin: 40px;
padding: 4px;
}
html, body {
height: 100%;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="resources/css/bootstrap.css"/>
<link rel="stylesheet" href="resources/css/w2ui-1.4.2.css"/>
<link rel="stylesheet" href="resources/css/font-awesome.css"/>
<script src="resources/js/jquery-2.1.0.min.js"></script><!-- Kendi import yaptığım -->
<script src="resources/js/jquery-2.1.4.min.js"></script>
<script src="resources/js/bootstrap.js"></script>
<script src="resources/js/w2ui-1.4.2.js"></script>
</head>
<body>
<!--<p><a href="userList.html">Delete User</a></p>-->
<div id="toolbar" style="padding: 4px; border: 1px solid silver; border-radius: 3px"></div>
<div id="main" style="position: absolute; top: 110px; left: 10px; bottom: 10px; right: 10px;"></div>
<script type="text/javascript">
$(function () {
$('#toolbar').w2toolbar({
name: 'toolbar',
items: [
{ type: 'button', id: 'homePage', caption: 'Main Page', img: 'icon-page', hint: 'Hint for item 1' },
],
onClick: function (target, data) {
if ( target === 'homePage' ) {
window.location.href = 'AdminPanel.html';
}
}
});
});
// widget configuration
var config = {
layout: {
name: 'layout',
padding: 4,
panels: [
{type: 'main', minSize: 200},
{type: 'right', size: '40%', resizable: true, minSize: 300},
]
},
grid: {
name: 'grid',
show: {
toolbar: true,
toolbarDelete: true
},
columns: [
{ field: 'recid', caption: 'ID', size: '5%', sortable: true, attr: 'align=center' },
{field: 'fname', caption: 'First Name', size: '33%', sortable: true, searchable: true},
{field: 'lname', caption: 'Last Name', size: '33%', sortable: true, searchable: true},
{field: 'email', caption: 'Email', size: '33%'},
{field: 'depart', caption: 'Department', size: '120px', render: 'depart'},
],
records: [
{recid: 1, fname: 'John', lname: 'Doe', email: '[email protected]', depart: 'Yazilim'},
{recid: 2, fname: 'Stuart', lname: 'Motzart', email: '[email protected]', depart: 'Yazilim'},
{recid: 3, fname: 'Jin', lname: 'Franson', email: '[email protected]', depart: 'Yazilim'},
{recid: 4, fname: 'Susan', lname: 'Ottie', email: '[email protected]', depart: 'Yazilim'},
{recid: 5, fname: 'Kelly', lname: 'Silver', email: '[email protected]', depart: 'Yazilim'},
{recid: 6, fname: 'Francis', lname: 'Gatos', email: '[email protected]', depart: 'Yazilim'},
{recid: 7, fname: 'Mark', lname: 'Welldo', email: '[email protected]', depart: 'Yazilim'},
{recid: 8, fname: 'Thomas', lname: 'Bahh', email: '[email protected]', depart: 'Yazilim'},
{recid: 9, fname: 'Sergei', lname: 'Rachmaninov', email: '[email protected]', depart: 'Yazilim'}
],
onClick: function (event) {
var grid = this;
var form = w2ui.form;
console.log(event);
event.onComplete = function () {
var sel = grid.getSelection();
console.log(sel);
if (sel.length == 1) {
form.recid = sel[0];
form.record = $.extend(true, {}, grid.get(sel[0]));
form.refresh();
} else {
form.clear();
}
}
}
},
form: {
header: 'Edit User',
name: 'form',
fields: [
{name: 'recid',
type: 'int',
required:true,
html: {caption: 'ID', attr: 'size="10" '}},
{
name: 'fname',
type: 'text',
required: true,
html: {caption: 'First Name', attr: 'size="40" maxlength="40"'}
},
{
name: 'lname',
type: 'text',
required: true,
html: {caption: 'Last Name', attr: 'size="40" maxlength="40"'}
},
{name: 'email',
required:true,
type: 'email', html: {caption: 'Email', attr: 'size="30"'}},
{name: 'depart',
required:true,
type: 'text', html: {caption: 'Department', attr: 'size="10"'}}
],
actions: {
AddUser: function () {
this.clear();
},
Save: function () {
var errors = this.validate();
if (errors.length > 0) return;
if (this.recid == 0) {
w2ui.grid.add($.extend(true, {recid: w2ui.grid.records.length + 1}, this.record));
w2ui.grid.selectNone();
this.clear();
} else {
w2ui.grid.set(this.recid, this.record);
w2ui.grid.selectNone();
this.clear();
}
}
}
}
}
$(function () {
// initialization
$('#main').w2layout(config.layout);
w2ui.layout.content('main', $().w2grid(config.grid));
w2ui.layout.content('right', $().w2form(config.form));
});
</script>
</body>
</html>