-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable_searching.html
More file actions
46 lines (45 loc) · 1.34 KB
/
table_searching.html
File metadata and controls
46 lines (45 loc) · 1.34 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Working with EasyUI</title>
<link rel="stylesheet" type="text/css" href="./css/default/easyui.css">
<script type="text/javascript" src="./assets/jquery.min.js"></script>
<script type="text/javascript" src="./assets/jquery.easyui.min.js"></script>
</head>
<body>
<h2>Show DataTable</h2>
<p>Showing a table of data.</p>
<input id="query" class="easyui-textbox" type="text"/><br><br>
<table id="dg" style="width:500px;"></table>
<script>
$('#dg').datagrid({
url:'get_users.php',
fitColumns:true,
pagination: true,
columns:[[
{field:'firstname',title:'First Name'},
{field:'lastname',title:'Last Name'},
{field:'gender',title:'Gender'},
{field:'email',title:'Email'},
{field:'phone',title:'Phone'},
]],
onClickRow : function(index, row){
alert(row.firstname + ' ' + row.lastname);
}
});
$('#query').textbox({
buttonText:'Search',
iconCls:'icon-man',
iconAlign:'left',
onClickButton : function(e){
var userQuery = $(this).val();
console.log(userQuery);
$('#dg').datagrid('reload',{
query : userQuery
});
}
});
</script>
</body>
</html>