Skip to main content

collapseItem()

hides all children of the target shape or collapses the group/swimlane

collapseItem(id: Id, dir?: TreeDirection): void;

Parameters:

  • id: string | number - the id of the item
  • dir: string - optional, defines the side the children will be hidden in relation to the root shape: "left", "right"

Example

diagram.collapseItem(123);

Note, that the dir parameter can be used only in the diagram that is initialized in the mindmap mode (type:"mindmap").

const diagram = new dhx.Diagram("diagram_container", {
type:"mindmap"
});
diagram.parse(data);

diagram.collapseItem("main", "left");

Change log:

The dir parameter has been added in v3.1.

Expanding/collapsing items