4.5 - Row
Introduction
A row object is used to store the activities found on a row of the Gantt chart. These activities are not stored directly on the row but in an activity repository. The default repository is of type IntervalTreeActivityRepository. Activities can be placed on lines within the row. The row delegates this work to a LinesManager. The default manager is of type EqualLinesManager.
Type Arguments & Hierarchy
Three type arguments are needed to define a row. The first one defines the type of the parent row, the second one defines the type of the children rows, the third one defines the type of the activities shown on the row. The following is an example that defines a Building, that is part of a Factory. The building has Machines in it. In the building row we are showing Shifts for the activity.
export class Building extends Row<Factory, Machine, Shift> { }
A model like this would allow us to display a hierarchy in the Gantt chart that might look like this:
Factory → Shift
Building 1
Building 2
Building 3
Machine A
Machine B
Building 4
Machine C
Machine D
Methods
Methods | Description |
---|---|
row.isExpanded(): boolean | Controls whether the row will show its children rows or not. |
row.getHeight(): number | Gets / sets the current height of the row. |
row.getMinHeight(): number | Gets / sets the minimum height of the row. |
row.getMaxHeight(): number | Gets / sets the maximum height of the row. |
row.getLayout(): Layout | Gets / sets the layout used by the row. The default is Gantt Layout. |
row.getLineCount(): number | Gets / sets the number of inner lines to show within the row. |
row.getLinesManager(): LinesManager | Gets /sets the lines manager used for controlling the lines, their location, their height, the placement of the activities. |
row.getName(): string | Gets / sets the name of the row, e.g. "Machine 1", "Building 1". |
row.getParent(): Row | Gets / sets the parent row. |
row.getRepository(): ActivityRepository | Gets / sets the repository used by the row to store the activities. |
row.getUserObject(): any | Gets / sets the optional user object. Use it to build a bridge to the business model. |
row.getZoneId(): ZoneId | Gets / sets the timezone represented by the row. Each row can be in its own timezone. |