Hi I am trying to use the grouping but can not figure out why I do not get the summary-row or summary-bar to display. When I click the button it sorts the data by the group but does not actually group each item.
I am retrieving data from a database and using serverlist to populate training_type and location.
Thank in advance for your help!
css:
.summary-row,
.summary-row.odd {
background-color: #EEEEEE;
font-weight: bold;
}
.gantt_grid div,
.gantt_data_area div {
font-size: 12px;
}
.summary-bar {
opacity: 0.4;
}
Buttons:
function showGroups(listname) {
if (listname) {
gantt.groupBy({
groups: gantt.serverList(listname),
relation_property: listname,
group_id: "key",
group_text: "label"
});
gantt.sort("start_date");
} else {
gantt.groupBy(false);
}
}
gantt.locale.labels.column_training_type = gantt.locale.labels.section_training_type = "Training Type";
gantt.locale.labels.column_location = gantt.locale.labels.section_location = "Location";
gantt.config.columns = [
{name: "text", label: "Task Name", tree: true, width: 175},
{name: "start_date", label: "Start Date", width: 75},
{name: "training_type", label: "Training Type", align: "center", width: 70, template: function (item) {return byId(gantt.serverList('training_type'), item.training_type) }},
{name: "location", label: "Location", align: "center", width: 65, template: function (item) {return byId(gantt.serverList('location'), item.location) }},
{name: "add", width: 40}
];
gantt.config.lightbox.sections = [
{name: "text", height: 20, map_to: "text", type: "textarea", focus: true},
{name: "start_date", height: 20, map_to: "start_date", type: "time", single_date: true},
{name: "training_type", height: 20, map_to: "training_type", type: "select", options: gantt.serverList("training_type")},
{name: "location", height: 20, map_to: "location", type: "select", options: gantt.serverList("location")},
gantt.templates.grid_row_class =
gantt.templates.task_row_class = function (start, end, task) {
if (task.$virtual)
return “summary-row”
};
gantt.templates.task_class = function (start, end, task) {
if (task.$virtual)
return "summary-bar";
};
gantt.init("gantt_here");
gantt.sort("start_date");
gantt.load("src/gantt2.php");
var dp=new gantt.dataProcessor("src/gantt2.php");
dp.init(gantt);