BeforeExpand

fires before expanding a shape

void BeforeExpand(string|number id,string dir){ ... };

Parameters

idstring|numberthe id of a shape
dirstringthe side the children will be shown in relation to the parent shape ("left", "right")

Example

diagram.events.on("beforeExpand", function(id) {
    console.log("Expanding " + diagram.data.getItem(id).text, dir);
    return true;
});

Related samples

Details

Returning false from the handler will block the selection.

See also
Change log

The dir parameter was added in v3.1.

Back to top