/
deep-array.json
106 lines (106 loc) · 2.64 KB
/
deep-array.json
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
"schema": {
"type": "object",
"title": "Comment",
"required": ["users"],
"properties": {
"users": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"copyname": {
"title": "Copy",
"type": "string"
},
"comments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"comment": {
"title": "Comment",
"type": "string",
"maxLength": 20,
"validationMessage": "Don't be greedy!"
},
"tags": {
"title": "Tags",
"type": "array",
"items": {
"type": "object",
"properties": {
"tag": {
"title": "Tag",
"type": "string"
}
}
},
"maxLength": 5
}
},
"required": ["comment"]
}
}
},
"required": ["name"]
}
}
}
},
"form": [
{
"type": "help",
"helpvalue": "<h4>Array Example</h4><p>Try adding a couple of forms, reorder by drag'n'drop.</p>"
},
{
"key": "users",
"type": "tabarray",
"add": "New",
"style": {
"add": "btn-success"
},
"items": [
{
"key": "users[].name",
"copyValueTo": "users[].copyname"
},
"users[].copyname",
{
"key": "users[].comments",
"items": [
{
"key": "users[].comments[].comment",
"type": "textarea"
},
{
"key": "users[].comments[].tags",
"items": [
{
"key": "users[].comments[].tags[].tag",
"type": "text",
"onChange": "log(path('model.users[]').name.length)"
},
{
"key": "users[].comments[].tags[].brad",
"condition": "path('model.users[]').name.length",
"type": "string",
"default": "Brad"
}
]
}
]
}
]
},
{
"type": "submit",
"style": "btn-info",
"title": "OK"
}
]
}