Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fb6c5c9

Browse files
committed
Update select.md
Added <optgroup> example
1 parent dbd2771 commit fb6c5c9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎fields/select.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,20 @@ If you select the first item, the `value` will be `"Personal"` in the model.
6262

6363
If you select the second item, the `value` will be `"en-US"` in the model.
6464

65+
### Creating an \<optgroup\> with Select field:
66+
67+
```js
68+
{
69+
type: "select",
70+
label: "Choose the fastest",
71+
model: "the-fastest",
72+
required: true,
73+
values: values: [
74+
{ name: "Marc Marquez", id: "93", group: "MotoGP" },
75+
{ name: "Valentino Rossi", id: "46", group: "MotoGP" },
76+
{ name: "Lewis Hamilton", id: "44", group: "Formula 1" },
77+
{ name: "Sebastian Vettel", id: "5", group: "Formula 1" }
78+
],
79+
validator: validators.required
80+
}
81+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /