Hello,
i have problem when grouping task with database. i try this demo https://docs.dhtmlx.com/gantt/samples/02_extensions/08_tasks_grouping.html and It Works !. but when i populate data from database tasks can’t grouping
Hello,
i have problem when grouping task with database. i try this demo https://docs.dhtmlx.com/gantt/samples/02_extensions/08_tasks_grouping.html and It Works !. but when i populate data from database tasks can’t grouping
This is my code
[code]
Tasks grouping html, body{ height:100%; padding:0px; margin:0px; overflow: hidden;} .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;
}
</style>
gantt.config.xml_date = "%Y-%m-%d %H:%i";
gantt.init("my_gantt");
gantt.config.columns = [
{name: "text", label: "Task name", width: "*", tree: true},
{name: "start_date", label: "Start time", align: "center", width: "*"},
{name: "duration", label: "Duration", align: "center", width: 46},
{name:"priority", label:"Priority", align: "center", width:55, template:function(obj){
return byId(gantt.serverList("priority"), obj.priority)
}},
{name: "add", label: "", width: 44}
];
gantt.config.order_branch = true;
gantt.config.grid_resize = true;
gantt.locale.labels.column_priority=
gantt.locale.labels.section_priority = "Priority";
function byId(list, id) {
for (var i = 0; i < list.length; i++) {
if (list[i].key == id)
return list[i].label || "";
}
return "";
}
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.config.lightbox.sections = [
{name: "description", height: 38, map_to: "text", type: "textarea", focus: true},
{name: "employee", map_to: "Employee_IdEmployee", type: "select", options: gantt.serverList("employee")},
{name: "tasktype", map_to: "TaskType_Id", type: "select", options: gantt.serverList("tasktype")},
{name: "proyek", map_to: "Proyek_IdProyek", type: "select", options: gantt.serverList("proyek")},
{name: "time", height: 72, type: "duration", map_to: "auto"}
];
gantt.locale.labels.section_employee = "Employee Name";
gantt.locale.labels.section_tasktype = "Task Type Name";
gantt.locale.labels.section_proyek = "Proyek Name";
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.load('data.php');
var dp = new dataProcessor("data.php");
dp.init(gantt);
</script>
[/code]
diplaying like this
http://imgur.com/a/z4VPZ
thank you
Hello,
As I see, there is no section with ‘Priority’ options at gantt.config.lightbox.sections.
Perhaps, event data also hasn’t this property. That is why it’s not possible to sort tasks by Priority. Please, check it.