-
Notifications
You must be signed in to change notification settings - Fork 2
/
json_types.html
53 lines (46 loc) · 1.53 KB
/
json_types.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>JSON Types</title>
<link rel="stylesheet" href="demo.css">
<script src="./theme.js"></script>
</head>
<body>
<h1><a href="index.html">gridchen Index</a> / JSON Types</h1>
<p>
Supported are the atomic JSON types string, boolean, integer and number.
Numbers are displayed and copied to clipboard in the default locale.
</p>
</body>
<script type="module">
import "./gridchen/webcomponent.js"
import {createInteractiveDemoGrid} from "./demo.js"
createInteractiveDemoGrid(
{
title: 'Array of Row Arrays',
type: 'array',
items: {
type: 'array',
items: [ // tuple schema
{title: 'string', width: 100, type: 'string'},
{title: 'boolean', width: 100, type: 'boolean'},
{title: 'integer', width: 100, type: 'integer'},
{title: 'number', width: 100, type: 'number'},
{title: 'uri', width: 100, type: 'string', format: 'uri'}
]
}
},
[
['foo', true, -1, -3.14, '[hash 3](#3)'],
['foo', true, -1, -3.14, '[hash 4](#4)'],
['foo', true, -1, -3.14, '[gridchen](http://github.com/decatur/gridchen)'],
['foo', 'error', 'error', 'error', 123]
]
);
window.onhashchange = function() {
const hash = window.location.hash;
alert(`You clicked ${hash}`);
}
</script>
</html>