onPropertyChange([callback], [remove])
Class: Menu. Method inherited from UIComponent.
Description:
Gets, registers or unregisters an event handler that listens for changes to this component's properties.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
function |
The event handler function that receives a PropertyChangeEvent object. Pass |
|
|
|
boolean |
false |
Set to |
Returns:
An array of handler functions if no arguments are passed, otherwise this component for method chaining.
Type: this | Array.<function()>
Examples:
// Example event object:
const e = {
target: object, // The container component that triggered the event.
type: string, // `change`.
property: string, // The property that was changed
oldValue: any, // Previous value of the changed property
newValue: any // New value of the changed property
};
