Initialize the data problem

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

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:
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

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:
https://docs.dhtmlx.com/gantt/desktop__working_time.html#changingcalendardynamically

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:
https://docs.dhtmlx.com/gantt/whatsnew.html#717

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:
https://snippet.dhtmlx.com/xhj1c00a
Probably, you are using an old Gantt version. The total slack calculation bug was fixed in the 7.1.7 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#717

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:
https://snippet.dhtmlx.com/40tsh9uz
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

This is to set another kind of data

Hello Dangxiaowei,
Thank you for sending the screenshots. It seems that I confused the link type. When I tried to use the SF link, I reproduced the issue:
https://snippet.dhtmlx.com/kt49mse2

However, it is not clear to me how to check the expected behavior in MS Project.
I added a few tasks and turned on highlighting the critical path and showing slack. But for some reason, none of the tasks are critical, all of them have 0 slack days:

Could you clarify how to reproduce the use case with critical tasks in MS Project? Or you can send me a simple test file so that I can investigate it.


Hello Yansen,
It should be related to the same issue. Could you send me a test MS Project file so that I can reproduce the issue locally?

total_slack_example.mpp (247.5 KB)

the project product version is project professional 2016 (chinese ), it is Trial version,We receive it from internet,You can do that, too。

According to my own analysis, the reason why the total time difference between dhtmlx and project under SF relationship is different is that for the pre task of SF relationship, dhtmlx believes that this pre task has only one post task, that is, the task with which it has SF relationship; Project and other products (P3) believe that there are two post tasks of this pre task, one is the post task with SF relationship, and the other post task is the node connected to the nearest critical path (for example, the virtual end node of the project). Both calculate the results, and select the minimum of the two values as LS and total slack of the task That’s the difference. Please check it carefully.

Hello,
Thank you for sending the example and for the explanation. Yes, it seems that MS Project relies on the difference between the Early start and Start parameters for the Total Slack calculation. But as soon as you move the task, both parameters obtain the same value, and Total Slack becomes 0 regardless of the dates.
The Free Slack value seems to be fixed regardless of where you move the task.

In DHTMLX Gantt, the Total Slack value is obtained from the successor. It should be correct for all link types except for the Start to Finish.
So, in the following snippet, task #3 should have 0 days for the Free Slack (because it will affect its successor) and 2 days for the Total Slack(because it will become a critical task after 2 days).
Task #4 should have 4 days for the Free Slack and Total Slack because it doesn’t affect its predecessor and will become a critical task after 4 days.
https://snippet.dhtmlx.com/6akjbn1o

I added it as a bug to our internal bug tracker. The dev team will fix it in the future, but I cannot give you any ETA.

Thank you, but we still hope to get the repair version and release date of the bug. When you get the repair date, please inform us as soon as possible. Thank you. In addition, it would be better if we could add four times of the task: the earliest start time, the latest start time, the latest start time and the latest completion time. These values are required in our project, and they are available in general tool software. Please consider whether you can let them go!

This kind of bug will also appear among SS related tasks. Such a problem will occur as long as the duration of the predecessor task is longer than that of the successor task.

Hello,

Thank you, but we still hope to get the repair version and release date of the bug. When you get the repair date, please inform us as soon as possible.

Periodically, we notify about the fixed bugs, so eventually, we’ll inform you that the bug is fixed.
Unfortunately, I cannot give you any ETA on when the bug is going to be fixed.


In addition, it would be better if we could add four times of the task: the earliest start time, the latest start time, the latest start time and the latest completion time. These values are required in our project, and they are available in general tool software. Please consider whether you can let them go!

I added your suggestion to our internal wishlist. The dev team will think about adding the date properties and the implement the feature of using them in the critical path and slack calculations.


This kind of bug will also appear among SS related tasks. Such a problem will occur as long as the duration of the predecessor task is longer than that of the successor task.

Thank you for letting me know about that bug. I added that information to our internal bug tracker. The bug will be fixed in the future, but I cannot give you any ETA.