【问题标题】:DHTMLX gantt chart hide parent tasks how?DHTMLX甘特图如何隐藏父任务?
【发布时间】:2020-04-24 16:43:24
【问题描述】:

在 DHTMLX 甘特图中

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

  1. 父母
    1.1 子父
    1.1.1 任务

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

你可以参考下面的截图'

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

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

【问题讨论】:

    标签: dhtmlx dhtmlx-scheduler


    【解决方案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

    【讨论】:

      猜你喜欢
      • 2020-05-07
      • 2016-07-22
      • 2011-06-03
      • 2016-05-25
      • 1970-01-01
      • 1970-01-01
      • 2023-02-16
      • 2016-08-13
      • 2015-12-05
      相关资源
      最近更新 更多