Skip to main content

beforeAdd

fires before a file is added to the data collection

beforeAdd: (file: object) => boolean | void;

Parameters:

  • file: object - the file object

Returns:

Return false to prevent adding of a file into the data collection; otherwise, true.

Example

form.getItem("simplevault").data.events.on("beforeAdd", function(file) {
console.log("beforeAdd", file);
// return false;
});
info

The beforeAdd event is an event of data collection