Handling selectable events
In addition to the standard configurable options of the selectable API, there are also a series of event callback options that can be used to specify functions that are executed at specific points during a select interaction. These options are listed in the following table:
Option |
Triggered when |
---|---|
|
The select interaction ends and each element added to the selection triggers the callback. |
|
Each selected element triggers the callback during the select interaction. |
|
A select interaction begins. |
|
A selection operation ends. |
|
Any elements that are part of the selectable, but are not selected during the interaction will fire this callback. |
|
Unselected elements will fire this during the select interaction. |
Selecting really only becomes useful when something happens to the elements once they have been selected, which is where this event model comes into play. Let's put some of these callbacks to work...