Skip to content

Commit 0cb2d21

Browse files
author
Lionel Bijaoui
committed
Dev for grouping updated
1 parent 2f1e6b7 commit 0cb2d21

File tree

1 file changed

+50
-13
lines changed

1 file changed

+50
-13
lines changed

dev/projects/grouping/app.vue

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,44 @@ export default {
2929
more: "More",
3030
things: "Things"
3131
},
32-
single: "blah"
32+
single: "blah",
33+
subname: ""
3334
},
3435
3536
schema: {
36-
groups: [
37+
fields: [
3738
{
39+
type: "group",
3840
legend: "Contact Details",
41+
tag: "div",
3942
fields: [
4043
{
4144
type: "input",
4245
model: "name",
4346
label: "Name",
4447
fieldOptions: {
4548
inputType: "text"
46-
}
49+
},
50+
required: true,
51+
validator: ["required"]
52+
},
53+
{
54+
type: "group",
55+
legend: "Subgroup",
56+
styleClasses: "subgroup",
57+
tag: "fieldset",
58+
fields: [
59+
{
60+
type: "input",
61+
model: "subname",
62+
label: "Name",
63+
fieldOptions: {
64+
inputType: "text"
65+
},
66+
required: true,
67+
validator: ["required"]
68+
}
69+
]
4770
},
4871
{
4972
type: "input",
@@ -56,6 +79,17 @@ export default {
5679
]
5780
},
5881
{
82+
type: "input",
83+
model: "single",
84+
label: "Single field (without group)",
85+
fieldOptions: {
86+
inputType: "text"
87+
},
88+
required: true,
89+
validator: ["string"]
90+
},
91+
{
92+
type: "group",
5993
legend: "Other Details",
6094
fields: [
6195
{
@@ -76,20 +110,12 @@ export default {
76110
}
77111
]
78112
}
79-
],
80-
fields: [
81-
{
82-
type: "input",
83-
model: "single",
84-
label: "Single field (without group)",
85-
fieldOptions: {
86-
inputType: "text"
87-
}
88-
}
89113
]
90114
},
91115
92116
formOptions: {
117+
validateAfterLoad: true,
118+
validateAfterChanged: true,
93119
fieldIdPrefix: "frm1-"
94120
}
95121
};
@@ -103,4 +129,15 @@ export default {
103129

104130
<style lang="scss">
105131
@import "../../style.scss";
132+
.field-group {
133+
border: 2px solid #bbb;
134+
padding: 8px;
135+
border-radius: 4px;
136+
}
137+
.subgroup {
138+
border-color: goldenrod;
139+
legend {
140+
color: #00268d;
141+
}
142+
}
106143
</style>

0 commit comments

Comments
 (0)