Hi,
Now i am customizing gantt with resource histogram using https://docs.dhtmlx.com/gantt/samples/11_resources/09_resource_histogram.html
example. Am facing a issue in constructing json using php gantt connector .
in Loghtbox
{ name: “owner”, type: “resources”, map_to: “owner”, options: gantt.serverList(“people”), default_value:WORK_DAY, unassigned_value: UNASSIGNED_ID},
In Task Table owner field Data Type : TEXT In this field data stored like this [{“resource_id”: “6”," value": “5”}]
In gantt.load (load.php)
In browser console :
“data”: [
{ “id”: 1, “text”: “Office itinerancy”, “type”: “project”, “start_date”: “02-04-2019 00:00”, “duration”: 17, “progress”: 0.4, “owner”: " [{“resource_id”:“5”, “value”: 3}] " , “parent”: 0},
]
}
Instead of
“data”: [
{ “id”: 1, “text”: “Office itinerancy”, “type”: “project”, “start_date”: “02-04-2019 00:00”, “duration”: 17, “progress”: 0.4, “owner”: [{“resource_id”:“5”, “value”: 3}] , “parent”: 0},
]
}
load.php
include (‘codebase/connector/gantt_connector.php’);
$res = new PDO(“mysql:host=localhost;dbname=gantt”, “root”, “”);
$gantt = new JSONGanttConnector($res);
$gantt->render_links(“gantt_links”,“id”,“source,target,type”);
$gantt->render_table(
“gantt_tasks”,
“id”,
“start_date,duration,text,type,owner,progress,sortorder,parent”
);
owner getting as string instead of object. How do i fix this ?