My Gantt Chart shows grouping correctly but also shows other column information highlighted in yellow in the header which is not required and not found in many examples listed here.
My intent is to show only the group name. Please let me know what i’m doing wrong, below is my code.
Blockquote
gantt.config.columns=[
{name:“text”, label:“Task ID”, tree:true, align:“center” },
{name:“start_date”, label:“Start Date”, align: “center” },
{name:“estimates”, label:“Current Estimate”, align: “center”, width:“*”},
{name:“duration”, label:“Duration”, hide:true},
{name:“end_date”, label:“End Date”, hide:true},
{name:“user”, label:“Assigned User”, hide:true},
{name:“state”, label:“State”, hide:true},
{name:“progress”, label:“Effort Progress Percentage”, hide:true},
{name:“percentage”, label:“Percentage”, hide:true},
{name:“ist”, label:“IST”, hide:true},
];
gantt.init(“gantt_here”);
var taskdata = {
“data”:[],
“links”:[]
};
//iterator to loop over the tasks present under a project
//builtin tags to read data from each task.
taskdata.data.push({“id”:<%<%builtin ID%>%>, “text”:link, “start_date”:“<%<%Start Date%>%>”, “estimates”:actualDuration, “duration”:“<%actualDuration%>”, “end_date”:“<%End Date%>”, “user”:“<%<%builtin Summary%>%>” + “/” + relMgr, “state”:“<%State%>”, “progress”: RelProgress, “percentage”:<%% Stories Done%>, “ist”:“<%IST%>”});
gantt.parse(taskdata);
function group(){
generate_serverlist();
group_toggle = !group_toggle;
if (group_toggle){
gantt.groupBy({
groups: gantt.serverList(“ist”),
relation_property: “ist”,
group_id: “key”,
group_text: “label”
});
}
else gantt.groupBy(false);
}
function generate_serverlist(){
for(var k=0; k<taskdata.data.length; k++){
var new_ist = {key: taskdata.data[k].ist, label: taskdata.data[k].ist};
ist_array.push(new_ist);
}
}
//remove duplicates
var temp_array = [];
for (var i = 0; i < ist_array.length; i++) {
var unique = true;
for (var j = 0; j < temp_array.length; j++) {
if (ist_array[i].key == temp_array[j].key) unique = false;
}
if (unique) temp_array.push(ist_array[i]);
}
ist_array = temp_array;
temp_array = [];
gantt.updateCollection(“ist”, ist_array);
}
Blockquote