设置虚拟根元素的 id
gantt.config.root_id = "root";
var tasks = {
data:[
{id:1, text:"Project #2", start_date:"01-04-2013", duration:18, parent:"root"}, {id:2, text:"Task #1", start_date:"02-04-2013", duration:8, parent:1},
{id:3, text:"Task #2", start_date:"11-04-2013", duration:8, parent:1}
],
links:[]
};
gantt.init("gantt_here");
gantt.parse(tasks);
root_id 定义任务树中的虚拟根节点。 当任务的 parent 属性与 root_id 值匹配时,该任务会显示在 gantt 树的顶层。