-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid.html
44 lines (40 loc) · 1.25 KB
/
grid.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
<!doctype html>
<html lang="en">
<head>
<!--
This is an HTML comment
You can write text in a comment and the content won't be visible in the page
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="https://glitch.com/favicon.ico" />
<!--
This is the page head - it contains info the browser uses
Like the title, which appears on the browser tab but not inside the page
Further down you'll see the content that displays in the page
-->
<title>Hello World!</title>
<script src="https://cdn.jsdelivr.net/npm/ag-grid-community/dist/ag-grid-community.min.js"></script>
</head>
<body>
<div
id="myGrid"
style="height: 200px; width: 500px"
class="ag-theme-alpine"
></div>
<script>
// setup the grid after the page has finished loading
document.addEventListener("DOMContentLoaded", () => {
const gridDiv = document.querySelector("#myGrid");
new agGrid.Grid(gridDiv, {
columnDefs: [
{ field: "make" },
{ field: "model" },
{ field: "price" },
],
rowData: __DATA__,
});
});
</script>
</body>
</html>