When users select and deselect files or create File Distributions, filespin.js will emit events as detailed below:-
Event | Description |
---|---|
ready | Raised when the Connector Dialog is ready and displayed. This event does not supply any data. |
closeConnector | Raised when the Connector Dialog is closed by user. This event does not supply any data. |
connector-file-selected | Raised when the user selects a file |
connector-file-deselected | Raised when the user deselects a file |
Listening to Connector Events
To listen to events, use the FileSpin.on API. You can listen to a specific event or all events using the special *
event.
//listen to 'connector-file-selected' event
FileSpin.on("connector-file-selected", function (data) {
console.log(data);
//Perhaps, hide the Connector once a file is selected
FileSpin.hideConnector();
});
//listen to all events
FileSpin.on("*", function (data, eventName) {
console.log(eventName, "triggered with data", data);
});
Connector Event Data
The events provide file data in the following formats:-
Event | Data Format |
---|---|
connector-file-selected | Standard Asset Data Format |
connector-file-deselected | Standard Asset Data Format |