DHTMLX甘特图如何隐藏父任务?

问题描述 投票:0回答:1

在DHTMLX甘特图中

我需要在左侧面板中显示所有层次结构任务,例如

  1. 父母1.1子家长1.1.1任务

但是右侧面板,我只需要显示子任务,而不显示父级和子级。

您可以参考下面的屏幕截图'enter image description here

参考链接:https://dhtmlx.com/docs/products/dhtmlxGantt/02_features.html

需要:1.我需要隐藏战略定义并获取/创建...仅右侧蓝色条。

dhtmlx dhtmlx-scheduler
1个回答
1
投票

请使用task_class template指定将应用于带有孩子的任务栏以隐藏它们的CSS类

getChildren方法,以检查目标任务是否具有第一级子任务:

gantt.templates.task_class = function(start, end, task){
  var children = gantt.getChildren(task.id);
  if(children.length)
    return "hideTask";

  return "";
};

CSS:

.hideTask{visibility: hidden;}

Demo

© www.soinside.com 2019 - 2024. All rights reserved.