I create a “SET” field and give it options, but the “default” option is ignored when I fill it in. How can I specify the default values?
{
"fields": [
{
"name": "Фон",
"type": "text",
"default": "#333333"
},
{
"name": "Название",
"type": "color",
"default": "#333333"
},
]
}
abernh
2
Default for field type SET
is set under the options
key.
Default for field type COLOR
is set via the spectrum.js
parameters ( Spectrum - The No Hassle jQuery Colorpicker )
{
"fields": [
{
"name": "Фон",
"type": "text",
"options": {
"default": "#333333",
}
},
{
"name": "Название",
"type": "color",
"options": {
"spectrum": {
"color": "#333333"
}
}
},
]
}
Ref:
/cp/modules/Cockpit/assets/components/field-color.tag
/cp/modules/Cockpit/assets/components/field-set.tag
/cp/modules/Cockpit/assets/components.js:685