Open Ruslan-Aleev opened 4 years ago
This can be solved in a crooked way, replace the name: 'options'
block in the grid (https://github.com/modmore/ClientConfig/blob/master/assets/components/clientconfig/js/mgr/widgets/window.settings.js#L93) with:
{
xtype: 'textarea',
id: config.id + '-options',
name: 'options',
fieldLabel: _('clientconfig.options') + '*',
description: _('clientconfig.options.desc'),
allowBlank: (config.record && (config.record.xtype === 'modx-combo')) ? false : true,
anchor: '100%',
hidden: (config.record && (config.record.xtype === 'modx-combo')) ? false : true,
value: _('clientconfig.options_default')
}
And in the clientconfig.options_default
lexicon set Yes==1||No==0
.
As a result, we have an example for the Selectbox for the user, which is convenient and the field is now required.
However, for non-Selectbox, the options parameter is not empty.
@Mark-H What do you think, should I do PR or are these corrections not particularly useful? Or is there another solution?
Summary
For settings with the "Selectbox" type, the "Field Options" field must be required, otherwise an empty list is displayed for the user. And if you set only value of the field, then the logic of the list itself is lost.
Expected behavior
"Field Options" field must be required
Environment
ClientConfig 2.3