Skip to content

Config Disabler

Disabler disables a field based on the value of other field or fields in the configuration.

Model

Disabler can be used as a plain Disabler or as Disabler Group. They are interchangeable.

Disabler

attribute description
seid*
seid
The object (field or table) against which to run the check
constraint*
Validator
The Validator to use

Note, that the constraint attribute only accepts a simple Validator and not a Validator Group. To leverage the logical operations provided by Validator Group do use the Disabler Group construct instead.

Example

{
  "seid": "main.target",
  "constraint": { "min": 1 }
}

Disabler Group

attribute description
operator*
'&&'|'||'
Defines the logical relationship between groups in the disablers array
disablers*
[Disabler]
The disabler array

Example

Disable the field if the value in main.forbidden does not equal 1 and either main.optional_1 or main.optional_1 is set to 0.

{
  "operator": "&&",
  "disablers": [
    {
      "operator": "||",
      "disablers": [
        {
          "seid": "main.optional_1",
          "constraint": { "equal": [0] }
        },
        {
          "seid": "main.optional_2",
          "constraint": { "equal": [0] }
        }
      ]
    },
    {
      "seid": "main.forbidden",
      "constraint": { "notEqual": [1] }
    }
  ]
}