Hidden Properties¶
Hidden Properties provides plugin developers capability to provide properties that will be shown to user once certain conditions or
checks are successful based on user inputs. Hidden Properties
help plugin developers control the flow of user inputs by
showing only the required properties at first and show the remaining properties based on the user input afterward.
The hideExpression
accepts an expression that evaluates to a boolean value. The expression can access values from
other properties. Access values from other properties as below:
model.<property_name>
- Use the
model.<property_name>
when the properties arestring
,boolean
,number
orinteger
. - To hide Y based on X, use
model.X
ormodel?.X
field.parent.<N>.parent.model?.<property_name>
Use the field.parent.<N>.parent.model?.<property_name>
when the properties are object
or array
.
field.parent.<N>.parent.model?.<root_names>?.<property_name>
- Use the
field.parent.<N>.parent.model?.<root_names>?.<property_name>
when the properties have different root object. - To hide Y based on B, use
field.parent.parent.model?.A?.B
Info
parent.<N>.parent
- Parent repeated N times as per JSON structure
Schema Configuration¶
Attributes¶
Attribute | Value | Description |
---|---|---|
hideExpression | boolean | If the value evaluates to true, the property is not shown in the UI. |
Where¶
- As a Sub-schema of dxFormProperties, for all data types property.
Applicable Data Types¶
- string
- integer
- number
- array
- object
- boolean
Usage¶
{
"<Property_Name>": {
"type": "string",
"dxFormProperties": {
"hideExpression": "<expression that evaluates to a boolean value>"
}
}
}
Warning
The expression works across a definition only. Plugin developers will not be able to use properties from multiple definitions as defined in schemas. For example, a property from linkedSourceDefinition can not be used in snapshotDefinition.
Examples¶
Examples
Expression | Description |
---|---|
!model.userName |
Returns true if the userName property is EMPTY. |
model.booleanFlag |
Returns true or false based on the booleanFlag property |
model.backupType === 'PRIMARY' |
Returns true if the backupType property is PRIMARY. |
model.backupType !== 'PRIMARY' && !model.userName |
Return true if backupType property is not PRIMARY and userName property is EMPTY. |
password
is a string property which will be shown in the UI if userName
is present and not empty.
password
is a string property which will be shown in the UI if userName
is present and not empty.