Appearance
onChange
The onChange event occurs when the value of an HTML element is changed. ↗️
Parameters
| Parameter | Type | Description |
|---|---|---|
| event | object | Event object. |
| mode | enum | INSERT | UPDATE | VIEW |
| columnName | string | The name of the database table column. |
| getColumnValue | function | See getColumnValue(columnName) |
| setColumnValue | function | See setColumnValue(columnName, columnValue) |
| setColumnStyle | function | See setColumnStyle(columnName, cssStyle) |
Return Value
None
✨ Example
js
((event, mode, columnName, getColumnValue, setColumnValue, setColumnStyle) => {
wpda.log.info("message from onChange", event, mode, columnName, getColumnValue())
})Notes
- The getColumnValue function returns the old column value. The new column value is available in event.target.value.
- Do NOT use setColumnValue to update the field value. This is done internally. Use this hook to add custom bahavior only.
- The onChange hook does not work on lookup columns.
