-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataTable2.html
57 lines (50 loc) · 1.69 KB
/
dataTable2.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<head>
<title>一覧</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="./libs/js/main.js"></script>
<script type="text/javascript" >
$(document).ready(function() {
$('#search').on('click', function(){
getAddress();
})
function getAddress() {
var zip = $('#zip').val() || '';
$('#address').DataTable({
"bServerSide": true,
"sScrollY": "300px",
"sDom":"ti",
"sAjaxSource": "/public/address.php?zip=" + zip,
"scroller": {
loadingIndicator: true
},
"destroy": true,
"language": {
"emptyTable" : "データが登録されていません。",
"info" : "_TOTAL_ 件中 _START_ 件から _END_ 件までを表示",
"infoEmpty" : "",
"loadingRecords" : "ロード中",
"processing" : "処理中...",
}});
}
});
</script>
<body>
<div>一覧</div>
<input type="text" name="zip" id="zip">
<button id="search">検索</button>
<table id="address" class="dataTable">
<thead>
<tr>
<th>zip</th>
<th>pref</th>
<th>city</th>
<th>town</th>
</tr>
</thead>
</table>
</body>
</html>