forked from jquery/jquery-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts-grid.html
More file actions
74 lines (69 loc) · 1.99 KB
/
products-grid.html
File metadata and controls
74 lines (69 loc) · 1.99 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
<!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.grid.js"></script>
<script src="dataview-odata.js"></script>
<script src="pager.js"></script>
<script src="grid-filter.js"></script>
<script src="grid-sort.js"></script>
<script>
$(function() {
var products = $.ui.odataDataview({
resource: "http://services.odata.org/Northwind/Northwind.svc/Products_by_Categories"
});
$( "#products" ).grid({
source: products,
heightStyle: "fill"
}).gridFilter().gridSort();
$( "#pager" ).pager({
source: products
});
products.refresh();
});
</script>
<style>
</style>
</head>
<body>
<h2>products! Click header for sort menu, use inputs for filtering, pager for paging</h2>
<div style="width:80em;">
<table id="products">
<colgroup>
<col width="25%">
<col width="35%">
<col width="20%">
<col width="20%">
</colgroup>
<thead>
<tr>
<th data-property="CategoryName" data-type="string">Category</th>
<th data-property="ProductName" data-type="string">Product</th>
<th data-property="QuantityPerUnit" data-type="string">Quantity Per Unit</th>
<th data-property="UnitsInStock" data-type="number">Units In Stock</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td id="pager" colspan="4" class="ui-state-default"></td>
</tr>
</tfoot>
</table>
</div>
</body>
</html>