-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (48 loc) · 1.48 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Fastable</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="/dist/fastable.js"></script>
</head>
<body>
<div class="container">
<h1>Fastable</h1>
<div class="row">
<div class="col-12-sm">
<div id="fastable-wrapper"></div>
</div>
</div>
</div>
<script>
function getData(successCallback) {
// get fake data
var request = new XMLHttpRequest();
request.open('GET', '/test/mock_data_0500.json', true);
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
//console.log(request.responseText);
var data = JSON.parse(request.responseText);
successCallback(data);
} else {
}
};
request.onerror = function() {
// There was a connection error of some sort
};
request.send();
}
this.getData(function (data) {
var fastable = new Fastable({
container: document.getElementById('fastable-wrapper'),
header: {
first_name: 'First Name'
},
data: data,
limit: 15
});
});
</script>
</body>
</html>