BeforeAdd

fires before adding a shape

void BeforeAdd(string|number id){ ... };

Parameters

idstring|numberthe id of a shape which will be added

Example

diagram.events.on("BeforeAdd", function(id){
    if (some_check)
        return false;
    return true;
});

Related samples

Details

Returning false from the event handler will prevent shape adding.

See also
Back to top