-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
90 lines (75 loc) · 2.49 KB
/
index.php
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic DataGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.4.4/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui-1.4.4/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.4.4/demo.css">
<script type="text/javascript" src="../jquery-easyui-1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui-1.4.4/datagrid-filter.js"></script>
</head>
<body>
<h2>Basic DataGrid</h2>
<style>
.icon-filter{
background:url('filter.png') no-repeat center center;
}
</style>
<script>
$(function(){
var dg = $('#dg').datagrid({
filterBtnIconCls:'icon-filter'
});
dg.datagrid('enableFilter', [{
field:'CompanyName',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'ContactName',
type:'numberbox',
options:{precision:1},
op:['equal','notequal','less','greater']
},{
field:'ContactTitle',
type:'text',
options:{
panelHeight:'auto',
onChange:function(value){
if (value == ''){
dg.datagrid('removeFilterRule', 'status');
} else {
dg.datagrid('addFilterRule', {
field: 'status',
op: 'equal',
value: value
});
}
dg.datagrid('doFilter');
}
}
}]);
});
</script>
</script>
<p>The DataGrid is created from markup, no JavaScript code needed.</p>
<div style="margin:20px 0;"></div>
<table id="dg" class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px"
data-options="singleSelect:true,collapsible:true,url:'data.php?CompanyName=Target',method:'get'">
<thead>
<tr>
<th data-options="field:'CompanyName',width:80">Company Name</th>
<th data-options="field:'ContactName',width:100">Contact Name</th>
<th data-options="field:'ContactTitle',width:80,align:'right'">Contact Title</th>
<th data-options="field:'unitcost',width:80,align:'right'">Address</th>
<th data-options="field:'attr1',width:250">Attribute</th>
<th data-options="field:'status',width:60,align:'center'">Status</th>
</tr>
</thead>
</table>
</body>
</html>
</body>
</html>