All w2ui controls have the same event flow. There are two ways you can add/remove events:
using on"Event" properties
using .on() and .off() methods
The first way is simple, can only be done during object creation and it limits you to a single event listener per event. The second way
lets you add multiple event listeners, but can only be called at run-time. It gives you a better control of the event flow.
Every widget property that start with "on" is an event.
When an event is emitted the handler function will receive one argument: event.
This argumnet is an object that contains useful information about the event. It has methods that allow you to
control the event flow, stop propagation, cancel or execute a function after default processing.
Event handler looks like:
By default all event handlers are triggered before any action is applied by the widget itself, hence, you can easily
cancel event default action by:
You can also define a function that will be executed after the default action is processed is processed. For example: