-
Notifications
You must be signed in to change notification settings - Fork 21
Events
Karl edited this page Nov 9, 2017
·
22 revisions
Selectable fires a number of custom events that the end-user can listen for.
To do so the end-user can attach a number of custom event listeners using the on()
method and pass the event name and a callback as the first two arguments:
const selectable = new Selectable(options);
const fn = function(/* params */) {
//
};
selectable.on('selectable.XXXX', fn);
Event listeners can be detached by calling the off()
method with the same arguments:
selectable.off('selectable.XXXX', fn);
Both the on()
and off()
methods function the same as the native addEventListener
and addEventListener
respectively.