-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
59 lines (59 loc) · 2.69 KB
/
index.html
File metadata and controls
59 lines (59 loc) · 2.69 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
<!DOCTYPE html>
<!-- primeui-json : v 1.0 by MichkaDaCoder-->
<!-- bind a PrimeUI Datatable from a JSON file or using a Webservice-->
<html>
<head>
<title>primeui-json</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script src="https://code.jquery.com/ui/1.8.1/jquery-ui.min.js"></script>
<script src="primeui-4.1.8/primeui.js"></script>
<script src="primeui-4.1.8/primeui-all.js"></script>
<script src="primeui-4.1.8/primeelements.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<link rel="stylesheet" href="primeui-4.1.8/primeui.css">
<link rel="stylesheet" href="primeui-4.1.8/themes/aristo/theme.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.8.1/themes/redmond/jquery-ui.css">
<script>
$(document).ready(function () {
//tableJson
$('#tableJson').puidatatable({
caption: 'Employees Table(JSON File)',
emptyMessage: "No Data",
selectionMode: "single",
responsive: true,
resizableColumns: true,
columns: [
{field: 'Fullname', headerText: 'Fullname', filter: true},
{field: 'Email', headerText: 'Email', filter: true},
{field: 'Job', headerText: 'Job', filter: true},
{field: 'Skills', headerText: 'Skills', filter: true}
],
datasource: function (callback) {
$.ajax({
type: "GET",
url: 'employees.json',
dataType: "json",
context: this,
//isLocal: true,
success: function (response) {
callback.call(this, response);
//$("#tableJson").html(response);
},
error: function (response) {
swal("Oops", "Something went wrong!" + response, "error");
}
});
}
});
});
</script>
</head>
<body>
<form>
<div id="tableJson"></div><br>
</form>
</body>
</html>