Skip to main content


detaches a handler from an event (which was attached before by the on() method)

detach(name: string): void;


  • name: string - the name of event to detach

Example"StyleChange", function(id){
console.log("The style of cell "+spreadsheet.selection.get()+" is changed");

By default detach() removes all event handlers from the target event. You can detach particular event handlers by using the context marker.

var marker = "any"; // you can use any string|object value"StyleChange", handler1);"StyleChange", handler2, marker);
// the next command will delete only handler2"StyleChange", marker);

Related articles

Event Handling