Events
It is used to configure custom behaviour for fields with certain events and actions.
Properties
Name | Description | Value |
---|---|---|
change | This indicates a change event | 'change' object OR a list of 'change' objects |
click | This is called on click over the field | 'click' object OR list of 'click' object |
open | This is applicable to 'select' field and triggers when dropdown is opened | 'open' object OR list of 'open' objects |
input | This is applicable to text boxes and triggered when input is entered | 'input' object OR list of 'input' objects |
change
event properties
This event is emitted whenever there is a change in the value of the field
Name | Description |
---|---|
type | It refers to the type of action to perform on this event |
ref | reference to the name of another field where action is to be performed. Not required if the action needs to be performed on the same field |
section | refers to the form section name (in case of grouped form) |
name | The name of the property to be used |
value | The value to be used |
valueFn | A function to be used to get the value of the field |
valueMap | A map of values to be used |
valueKey | Used for select field which fetches data from remote and contains the data of the response in the memory. valueKey here refers to one the value from the response key to be used as value |
payload | This is payload data used for type event_emitter |
type
properties
Name | Description |
---|---|
propSetter | Used to set a property of the field |
setter | Used to set the value of the field |
eventEmitter | Used to emit a global event |
setterCondition | Used to set the value of the field based on some condition |
Event Emitter properties
Following is a list of internal events which can be used to implement advanced form behaviours.
Event Type | Description |
---|---|
$end_of_page | Used to set the last page in a group form |
$reset_end_of_page | Used to reset the last page in a group form |
Example usage
{
"events": {
"change": [
{
"type": "event_emitter",
"eventType": "$end_of_page",
"payload": {
"value": 3
},
"value": "new"
},
{
"type": "event_emitter",
"eventType": "$reset_end_of_page",
"payload": "",
"value": "renewal"
}
]
}
}