forked from fin-hypergrid/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
partialtest.html
85 lines (75 loc) · 1.94 KB
/
partialtest.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>
<head>
<meta charset="UTF-8">
<style>
.hypergrid {
bottom: 0;
height: calc(100% - 200px);
left: 0;
max-height: calc(100% - 200px);
overflow-x: hidden;
position: absolute;
right: 0;
width: 100%;
}
.hypergrid fin-hypergrid {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 10px;
}
</style>
<title>Hyperfin Test</title>
<script src="jquery-1.11.2.min.js"></script>
<script src="../../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="../polymer/html/fin-hypergrid.html">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12">
<button class="btn btn-primary" id="button-load">Load the partial</button>
<button class="btn btn-primary" id="button-delete">Delete the partial</button>
</div>
</div>
<div class="row">
<div class="col-xs-12" id="view"></div>
</div>
</div>
<!-- // <script src="../fin-hypergrid.min.js"></script> -->
<script>
var doc = $(document),
data = {
cols: ['foo', 'bar', 'foobar', 'barfoo'],
rows: []
},
row;
for (var i = 1000; i >= 0; i--) {
row = {};
data.cols.forEach(function (col) {
row[col] = Math.random();
});
data.rows.push(row);
}
doc.ready(function () {
var buttonDelete = $('#button-delete'),
buttonLoad = $('#button-load'),
view = $('#view');
buttonDelete.click(function () {
view.empty();
});
buttonLoad.click(function () {
view.load('partial.html');
});
});
function populateHypergrid(newHypergrid) {
var hypergrid = newHypergrid,
hypergridModel = hypergrid.getBehavior();
hypergridModel.setHeaders(data.cols);
hypergridModel.setFields(data.cols);
hypergridModel.setData(data.rows);
}
</script>
</body>
</html>