Initialize the data problem


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

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.


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


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:

  • All right. Thank you very much for your help


* 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


Hello Dangxiaowei,
If you want to filter tasks, you need to use the onBeforeTaskDisplay event handler:
To filter tasks depending on their level, you can check the temporary property $level.
Here is an example of how it can be implemented:

If you want to remove these tasks, you can also use this temporary property and iterate all tasks with the eachTask method:

      if (task.$level > max_level) gantt.deleteTask(

Here is the snippet:

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


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


Hello Dangxiaowei,
The placeholder task is an unscheduled task, it won’t show the current date.
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)
    return gantt.templates.grid_date_format(date);
Here is the snippet:


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


Hello Dangxiaowei,
You can change the views by modifying the layout configuration:
I have the following samples where you can toggle the grid and timeline:

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:


Hello, I am setting the task calendar when the task duration is unchanged and the end time is changed. How to achieve this


Hello Dangxiaowei,
If you add a new calendar after the task is loaded, you need to manually recalculate the dates. The following article describes how to do that:


Hello, I have loaded 5000 tasks at the same time, but when I double-click to get the total time difference of the task, the value is very slow.I just call the API you provided and set time = gantt.getTotalSlack(task);How to optimize it.Or how to use Gantt in a Worker


Hello Dangxiaowei,
Thank you for letting us know about the issue. I added it as a bug to our internal tracker. The dev team will try to fix it in the future, but I cannot give you any ETA.


Hello, I set it

gantt.config.schedule_from_end = false;
gantt.config.project_start = new Date(2021, 11, 15);
If get

Four values Earliest start, earliest finish, latest start, latest finish


Hello Dangxiaowei,
The performance with the Total Slack calculation was improved in the 7.1.7 version:

Unfortunately, your question in the last message is not clear to me. Please, describe it in more detail.


Hello! There is a problem with this calculation. For task 4, getfreeslack = 2, gettotalslack = 2
But all you’ve calculated is 4


Hello Dangxiaowei,
I couldn’t reproduce that issue in the snippet:
Probably, you are using an old Gantt version. The total slack calculation bug was fixed in the 7.1.7 version:

If that doesn’t help you, probably, the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
In that case, please add your configuration to the following snippet and make sure that the issue is reproduced there:
Then, click on the Save button and send me the link.
Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.


This is the data that can be added by providing examples on your official website