I need help regarding parent task in my gantt. As the XML data shown below, it should be able to display parent-child task properly, but when I load my gantt, it shows blank. I tried to remove the parent parameter, then load it and somehow it shows properly without parent-child task relation. How to fix it ?
GanttConnector
[code]$gridConn = new GanttConnector($res,“Oracle”);
$gridConn->render_sql(
"select WBS_ID, to_char(START_DATE,'MM/DD/YYYY') as START_DATE,DURATION,WBS_PARENT_ID as parent, WBS_NAME as TEXT,PROGRESS_WBS as PROGRESS from WBS where PROJECT_ID=900057",
"WBS_ID",
"START_DATE(start_date), DURATION(duration), TEXT(text), PROGRESS(progress),PARENT(parent)"
);
}[/code]
XML data
[code]This XML file does not appear to have any style information associated with it. The document tree is shown below.
Chenged my connector intoo this but still doesn’t wor either
$gridConn->render_complex_sql(
"select WBS_ID,
to_char(START_DATE,'MM/DD/YYYY') as START_DATE,
DURATION,
WBS_NAME as TEXT,
PROGRESS_WBS as PROGRESS,
LEVEL as sortorder,
WBS_PARENT_ID as parent
from WBS
where PROJECT_ID=900057
connect by wbs_parent_id = prior wbs_id start with wbs_id='900057.1'
order siblings by wbs_parent_id",
"WBS_ID",
"start_date, duration,text, progress, sortorder, parent "
);
Hello,
if the issue is still actual,
Looks like you root task specify ‘parent’ as ‘root’, which is not default value for the topmost task. The current version of gantt hides items which parent is not one of existing tasks and not a root node.
You can either use some falsy value for ‘parent’ property of topmost task or specify gantt.config.parent_id property docs.dhtmlx.com/gantt/api__gantt … onfig.html
There are also seems to be some issues with the formatting of values that come from xml connector (at least with the data I copied from your message), in my case I have to manually trim some values to make everything work (JSON connector wouldn’t have such issue):
Here is a code that I had to add in order to display your data: