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 be done during object creation, but limits you to a single event listener per event. The second way
lets you add multiple event listeners, but can only be used at run-time. It gives you a better control of the event flow.
Every widget property that start with "on" is an event.
Executes all event listeners added with .on() method.
Event Handler Function
When an event is emitted the handler function will receive one parameter: function(event).
This parameter event is an object that contains useful information about the event.
Event handler looks like:
By default all event handlers are triggered before the default behavior. You can cancel event default behavior by:
You can also define a function that will be executed after the default behavior is processed. For example:
You can define several of those functions and all will be executed.