[]
You must use a hierarchy schema to build the GanttSheet task tree. There are three types of hierarchy, Parent, Level, and Children in a GanttSheet task tree. Each of them can be configured when adding a table to the data manager. You can also manually change the used build type by using schema.hierarchy.type
of the data table options.
In Parent hierarchy, the hierarchy type 'Parent' is used, and the primary key is used to indicate the hierarchy id.
The following code sample shows how to set parent hierarchy in the GanttSheet.
schema: {
hierarchy: {
type: "Parent",
column: "parentId"
},
columns: {
id: { isPrimaryKey: true }, // The primary key is required to build the hierarchy tree nodes
taskNumber: { dataType: "rowOrder" } //The row order is required in Id-ParentId type to ensure that you update the correct data
}
}
In Level hierarchy, the hierarchy type 'Level' is used. In this case, the primary key is not required, however, it’s better to indicate the primary key.
The following code sample shows how to set parent hierarchy in the GanttSheet.
schema: {
hierarchy: {
type: "Level",
column: "level"
}
}
In Children hierarchy, the hierarchy type 'Children' is used. In this case, the primary key is not required, however, it’s better to indicate the primary key for the child.
The following code sample shows how to set parent hierarchy in the GanttSheet.
schema: {
hierarchy: {
type: "ChildrenPath",
column: "children"
}
}