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 e569b92

Browse files
Merge pull request #17 from goatandsheep/develop
Custom properties
2 parents f711e2e + 84d4b88 commit e569b92

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎fields/field_properties.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,35 @@ For fields [select](select.md), [checklist](checklist.md), [selectEx](selectex.m
112112
}
113113
```
114114

115+
## Custom properties
115116

117+
You can add custom properties, such as `data-attributes`, to fields by using an `attributes` object. To add properties to the input field itself, simply specify the attribute names and values in the model:
116118

119+
```javascript
120+
{
121+
type: "input",
122+
inputType: "text",
123+
model: "first_name",
124+
label: "First Name",
125+
attributes: {
126+
"data-toggle": "collapse",
127+
"title": "Some Tooltip Title"
128+
}
129+
}
130+
```
131+
132+
You can also specify the attributes of the surrounding wrapper and label:
133+
134+
```javascript
135+
{
136+
type: "input",
137+
inputType: "text",
138+
model: "first_name",
139+
label: "First Name",
140+
attributes: {
141+
wrapper: { "data-toggle": "collapse" },
142+
input: { "data-toggle": "tooltip", "title": "Some Tooltip to be displayed by Bootstrap Tooltips" },
143+
label: { "custom-attr": "custom-value" }
144+
}
145+
}
146+
```

0 commit comments

Comments
(0)

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