You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fields/field_properties.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,5 +112,35 @@ For fields [select](select.md), [checklist](checklist.md), [selectEx](selectex.m
112
112
}
113
113
```
114
114
115
+
## Custom properties
115
116
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:
116
118
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" },
0 commit comments