afterCollapse

fires after an item has been collapsed

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

Parameters

idstring|numberthe id of an item which has been collapsed
dirstringoptional, the side the children were hidden in relation to the parent shape
("left" or "right" for type:"topic", otherwise - undefined)

Example

diagram.events.on("afterCollapse", function(id, dir) {
    console.log(diagram.data.getItem(id).text + " was collapsed", dir);
});
 
// For editor
editor.diagram.events.on("afterCollapse", function(id, dir) {
    console.log(editor.diagram.data.getItem(id).text + " was collapsed", dir);
});

Related samples

See also
Change log

The dir parameter was added in v3.1.

Back to top