I’m trying to load my gantt chart from an REST API framework but so far its not working. How can I solves this and how can I get all the data on a nested object for example the name: “assign_to/official_name”,?
Thank you for all your help.
HTML :
[code] gantt.config.columns = [
{name: "assign_to.employee_id", label: "Employee ID", align: "left", width: 70},
{name: "assign_to.official_name", label: "Employee Name", tree: true, align: "left", width: 250}
];
function initializeGantt() {
gantt.init("my_scheduler", new Date('2017, 01, 01'), new Date('2017, 12, 31'));
gantt.load("http://127.0.0.1/test/work_list/5/");
gantt.showDate(new Date('2017, 09, 01'));
}
initializeGantt();
</script>[/code]
REST API :
[code][
{
“id”: 11,
“start_date”: “2017-06-1”,
“end_date”: “2017-06-7”,
“parent_project_content”: {
“id”: 5,
“name”: “Jarvis”,
“description”: “AI Model”,
“task”: {
“id”: 2,
“name”: “Texturing”,
“description”: null
},
}
“assign_to”: {
“id”: 21,
“employee_id”: “28141”,
“official_name”: “Hal jordan”,
},
},
{
“id”: 14,
“start_date”: “2017-06-15”,
“end_date”: “2017-06-19”,
“parent_project_content”: {
“id”: 5,
“name”: “Jarvis”,
“task”: {
“id”: 1,
“name”: “Modeling”,
“description”: “3d modeling work”
},
}
“assign_to”: {
“id”: 92,
“employee_id”: “28144”,
“official_name”: “Kyle Rayner”,
},
}
][/code]