-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (60 loc) · 2.18 KB
/
index.html
File metadata and controls
69 lines (60 loc) · 2.18 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
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<!-- <link href="./betterTable/styles/betterTable.css" rel="stylesheet" /> -->
<link href="./betterTable/styles/betterTableFlex.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel="stylesheet">
<link href="site.css" rel="stylesheet" />
<script src="./betterTable/src/betterTableFlex.js"></script>
</head>
<body>
<div id="container" style="height: 500px;"></div>
<script>
const rows = [];
for (let i = 0; i < 500000; i++) {
rows.push({
email: 'someemail@email.com',
fname: (i+1),
lname: 'LastName' + Math.round((Math.random() * 1000000)),
username: 'Username' + Math.round((Math.random() * 1000000)),
});
}
const tick = Date.now();
const bt = new BetterTable.Table({
columns: {
email: { name: 'Email', props: { width: '100%', minWidth: '800px' } },
fname: { name: 'First Name', props: { minWidth: '800px' } },
lname: { name: 'Last Name', props: { minWidth: '800px' } },
username: { name: 'Username', props: { minWidth: '800px' } },
},
rows: rows,
appendTo: document.getElementById('container'),
customSortClass: 'material-icons'
});
console.log('BetterSelect initialized in', (Date.now() - tick) + 'ms');
const $filter = document.createElement('input');
$filter.className = 'btf-filter';
$filter.placeholder = 'Filter'
bt.$toolbarEl.appendChild($filter);
let timeout = null;
$filter.oninput = function() {
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(function() {
bt.filter = $filter.value
}, 100);
};
bt.onCellDoubleClick.connect(function(Cell) {
console.log(Cell);
});
bt.onColumnClick.connect(function (Column) {
Column.toggleSort();
});
setTimeout(function() {
console.log(bt.getSortedColumns());
}, 2000);
</script>
<span>*Browser may have insufficient maximum window element height to support total row count</span>
</body>
</html>