groups tasks by the specified task's attribute
config | object|boolean | the grouping configuration object, or false to ungroup tasks |
Available only in PRO Edition
// one-level grouping
gantt.groupBy({
relation_property: "priority",
groups: [
{key:0, label: "High"},
{key:4, label: "Normal"},
{key:5, label: "Low"},
],
group_id: "key",
group_text: "label",
save_tree_structure: true
});
//multi-level grouping
gantt.groupBy({
relation_property: "priority",
groups: [
{key:0, label: "High"},
{key:4, label: "Normal"},
{key:5, label: "Low"},
// multi level groups
{key:1, label: "Give High Attention", "priority":0},
{key:2, label: "Resolve Immediately", "priority":0},
{key:3, label: "Keep For Next Release", "priority":5}
],
group_id: "key",
group_text: "label"
});
// using collections
gantt.serverList("priority", [
{key:1, label: "High"},
{key:2, label: "Normal"},
{key:3, label: "Low"}
]);
gantt.groupBy({
groups: gantt.serverList("priority"),
relation_property: "priority",
group_id: "key",
group_text: "label"
});
// ungrouping tasks
gantt.groupBy(false);
This functionality is available in the PRO edition only.
This method is defined in the grouping extension, so you need to activate the grouping plugin. Read the details in the Grouping Tasks article.
The grouping configuration object has the following properties:
Please, note:
gantt.templates.task_class=function(start, end, task){
if(task.$virtual)
return "summary-bar";
};