Skip to main content

afterCollapse

fires after an item has been collapsed

afterCollapse: (id: Id, dir?: TreeDirection) => void;

Parameters:

  • id: string | number - the id of an item which has been collapsed
  • dir: string - optional, 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);
});

Change log:

The dir parameter has been added in v3.1.