Handling Events

Attaching Event Listeners

You can attach event listeners with the spreadsheet.events.on() method:

spreadsheet.events.on("AfterColumnAdd", function(cells){
    console.log("A new column is added");
});

Related sample:  Spreadsheet events

The names of events are case-insensitive.

Detaching Event Listeners

To detach events, use spreadsheet.events.detach():

var addcolumn = spreadsheet.events.on("AfterColumnAdd", function(cells){
    console.log("A new column is added");
});
spreadsheet.events.detach(addcolumn);

Calling Events

To call events, use spreadsheet.events.fire():

spreadsheet.events.fire("name",args);
// where args is an array of arguments

The list of events is available in the API section.

Back to top