-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlocked.js
68 lines (62 loc) · 2.56 KB
/
locked.js
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
import { RenderTimer, FPS, Scroller } from '../util/util.js';
async function init() {
const response = await fetch('../util/10000.json');
const json = await response.json();
RenderTimer.start({
sync : false,
callback() {
const grid = new agGrid.Grid(document.getElementById('container'), {
columnDefs : [
{ field : 'id', headerName : 'Id', width : 100, pinned : 'left' },
{ field : 'firstName', headerName : 'First name', width : 130, pinned : 'left' },
{ field : 'surname', headerName : 'Surname', width : 130, pinned : 'left' },
{ field : 'city', headerName : 'City', width : 150 },
{ field : 'age', headerName : 'Age', width : 100 },
{
field : 'color',
headerName : 'Color',
width : 120,
cellStyle : params => ({ backgroundColor : params.value })
},
{
field : 'score', headerName : 'Score', width : 120, cellRenderer({ value }) {
return `
<div style="
width : ${value / 10}%;
background-color: blue;
height : 3px;
position: absolute;
top: 0;
left :0;
"></div>
${value}
`;
}
},
{ field : 'start', headerName : 'Start', width : 120/*, type: 'date', format: 'YYYY-MM-DD'*/ },
{
field : 'done',
headerName : 'Done',
width : 90,
cellRenderer : params => params.value ? 'Yes' : 'No'
},
{ field : 'rating', headerName : 'Rating', width : 90 }
],
rowData : json,
onGridReady() {
RenderTimer.stop();
}
});
setTimeout(() => {
FPS.start();
Scroller.scroll({
element : document.querySelector('.ag-body-viewport'),
callback() {
FPS.stop();
}
});
}, 500);
}
});
}
init();