Initialize the data problem


#1

samples/02_extensions/18_linked_tasks.html Add lag to the relationship in Links but the page that appears after setting is not drawn according to the data

{
“id”: “25”,
“source”: “12”,
“target”: “19”,
“type”: “0”,
lag: “2”
}, {
“id”: “17”,
“source”: “18”,
“target”: “19”,
lag: “2”,
“type”: “0”
}


Set a task resource exception
#2

Hello Dangxiaowei,
After I add the lag parameter to the links, task 2.3 is moved to a new date like it is shown on your screenshot. Please, clarify how you imagine it should work.


#3

Task1 I set lag 2 but the page shows 3, How do I make the page look the same as the lag I set


#4

Hello Dangxiaowei,
Thank you for the clarification.
There are 2 links that point to the same task. Task #2.3 cannot start earlier because of Task #2.2. To make it work as you want, it would require to move Task #1 to 03 April. But that is a backward scheduling mode when the tasks are scheduled from successors. To enable that mode, you need to turn on the gantt.config.schedule_from_end option:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#backwardscheduling


#5
  • All right. Thank you very much for your help

#7

* How do I present and unload tasks based on the level of the task WBS, * Now I’m going to set the display level 4 task to a subset of that and put it away


#8

Hello Dangxiaowei,
If you want to filter tasks, you need to use the onBeforeTaskDisplay event handler:
https://docs.dhtmlx.com/gantt/api__gantt_onbeforetaskdisplay_event.html
To filter tasks depending on their level, you can check the temporary property $level.
Here is an example of how it can be implemented:
http://snippet.dhtmlx.com/5/37729e533

If you want to remove these tasks, you can also use this temporary property and iterate all tasks with the eachTask method:
https://docs.dhtmlx.com/gantt/api__gantt_eachtask.html

    gantt.eachTask(function(task){
      if (task.$level > max_level) gantt.deleteTask(task.id)
    })

Here is the snippet:
http://snippet.dhtmlx.com/5/03412e8ef

If you need something different, please, describe your question in more detail.


#9


I set it this way but it doesn’t show the start time how can I change that


#10

Hello Dangxiaowei,
The placeholder task is an unscheduled task, it won’t show the current date.
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html
The easiest way to change that would be to modify the date_grid template and show the dates for the placeholder task:

gantt.templates.date_grid = function(date, task, column){
  if(task && task.type == 'placeholder' && gantt.config.show_unscheduled){
    return gantt.templates.grid_date_format(date)
  }else{
    return gantt.templates.grid_date_format(date);
  }
}

https://docs.dhtmlx.com/gantt/api__gantt_date_grid_template.html
Here is the snippet:
http://snippet.dhtmlx.com/5/b8e7542a1


#11

Hi Ramil, I want to display tables and network graphs dynamically with a button control



#12

Hello Dangxiaowei,
You can change the views by modifying the layout configuration:
https://docs.dhtmlx.com/gantt/desktop__layout_config.html
I have the following samples where you can toggle the grid and timeline:
http://snippet.dhtmlx.com/5fc27c820
http://snippet.dhtmlx.com/5/ecdb905f9

If you want to modify the layout in a more complex way, you need to implement a custom solution. I have the following snippets that can help you to start:
https://snippet.dhtmlx.com/5/9ec902bf7
https://snippet.dhtmlx.com/5/fe84dbaaf