-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.json
More file actions
76 lines (71 loc) · 2.35 KB
/
form.json
File metadata and controls
76 lines (71 loc) · 2.35 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
70
71
72
73
74
75
76
{
"elements": [
{
"caption": "List with dynamic Form",
"type": "List",
"name": "List",
"add": true,
"delete": true,
"rowCount": 5,
"columns": [
{
"caption": "Type",
"name": "Type",
"width": "500px",
"edit": {
"type": "Select",
"options": [
{ "caption": "Variable", "value": 0 },
{ "caption": "Value", "value": 1 }
]
},
"add": 0
}
],
"values": [
],
"form": [
"$form = [];",
"$form[] = [",
" 'type'=> 'Select',",
" 'name'=> 'Type',",
" 'caption'=> 'Type',",
" 'options'=> [",
" ['caption' => 'Variable', 'value'=> 0 ],",
" ['caption' => 'Value', 'value' => 1 ]",
" ],",
" 'onChange' => 'FormTest_UpdateForm($id, \"Type\", $Type);'",
"];",
"$visible = ($List['Type'] == 0) ? true : false;",
"$form[] = [",
" 'type'=> 'SelectVariable',",
" 'name'=> 'VariableID',",
" 'caption'=> 'VariableID',",
" 'visible'=> $visible",
"];",
"$visible = ($List['Type'] == 1) ? true : false;",
"$form[] = [",
" 'type'=> 'NumberSpinner',",
" 'name'=> 'Value',",
" 'caption'=> 'Value',",
" 'visible'=> $visible",
"];",
"if (isset($List)) {",
" $form[] = [",
" 'type'=> 'ValidationTextBox',",
" 'caption'=> 'List dump',",
" 'value' => json_encode($List)",
" ];",
"}",
"return $form;"
]
},
{
"type": "Button",
"caption": "Show List",
"onClick": "echo IPS_GetProperty($id, 'List');"
}
],
"actions": [],
"status": []
}