forked from jquery/jquery-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelopers-grid.html
More file actions
83 lines (78 loc) · 1.96 KB
/
developers-grid.html
File metadata and controls
83 lines (78 loc) · 1.96 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Grid: Sorting, Paging, Filtering</title>
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
<link rel="stylesheet" href="../demos/demos.css">
<script src="../jquery-1.7.2.js"></script>
<script src="../external/jquery.tmpl.js"></script>
<script src="../ui/jquery.ui.core.js"></script>
<script src="../ui/jquery.ui.widget.js"></script>
<script src="../ui/jquery.ui.button.js"></script>
<script src="../ui/jquery.ui.menu.js"></script>
<script src="../ui/jquery.ui.position.js"></script>
<script src="../ui/jquery.ui.popup.js"></script>
<script src="../ui/jquery.ui.observable.js"></script>
<script src="../ui/jquery.ui.dataview.js"></script>
<script src="../ui/jquery.ui.dataviewlocal.js"></script>
<script src="../ui/jquery.ui.grid.js"></script>
<script src="pager.js"></script>
<script src="grid-filter.js"></script>
<script src="grid-sort.js"></script>
<script>
$(function() {
var localDevelopers;
$.ajax({
dataType: "json",
url: "developers.json",
async: false,
success: function( result ) {
localDevelopers = result;
}
});
var developers = $.ui.dataviewlocal({
input: localDevelopers,
paging: {
limit: 5
}
});
$( "#developers" ).grid({
source: developers,
heightStyle: "fill"
}).gridFilter().gridSort();
$( "#pager" ).pager({
source: developers
});
developers.refresh();
});
</script>
</head>
<body>
<h2>...</h2>
<table id="developers">
<caption>Developers Grid</caption>
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<thead>
<tr>
<th data-property="firstName">First Name</th>
<th data-property="lastName">Last Name</th>
<th data-property="country">Country</th>
<th data-property="bitcoins" data-type="number">Bitcoins</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td colspan="4"id="pager"></td>
</tr>
</tfoot>
</table>
</body>
</html>