forked from gabrielsroka/gabrielsroka.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatables.html
35 lines (35 loc) · 968 Bytes
/
datatables.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
<html>
<head>
<title>DataTables</title>
<link href='https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css' rel="stylesheet">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<table id=datatable>
<thead><tr><th>Label</th><th>AppName</th></tr></thead>
</table>
<script src='https://code.jquery.com/jquery-3.3.1.js'></script>
<script src='https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js'></script>
<script>
const baseUrl = 'https://gsroka-neto.oktapreview.com';
$(document).ready(function () {
$('#datatable').DataTable({
ajax: {
url: `${baseUrl}/api/v1/users/me/appLinks`,
dataSrc: '',
xhrFields: {
withCredentials: true
},
cache: true, // turn off ?_=[TIMESTAMP]
headers: {accept: 'application/json'}
},
columns: [{data: 'label'}, {data: 'appName'}]
});
});
</script>
</body>
</html>