How to set gantt project start date

I don’t set the time for the project here. The document says that the earliest time and the latest time of the sub task will be used as the cycle. Why will it go back 100 years? Can you help me? I don’t understand. Thank you

Yes, if a task has the project type, it will depend on the dates of its children.
I couldn’t reproduce the issue in the snippet:

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.

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.

Thank you for your reply. I also want to ask how to get the task information from the click event. The parameters of the row click event are only given the id and e, one is the dom, the other is the click event. There is no way to get the task. I went to check the related api of getTask, and there is no way to get the task through the dom. I am at a loss

To obtain the task you clicked on, you need to use the getTask method. You can get it from the id parameter of the onTaskClick event handler:
Here is an example:

But it is possible to obtain the task ID from the DOM elements. The task row in the grid and task bar in the timeline have the data-task-id attribute that has the task ID:

You can use the gantt.utils.dom.closest method to obtain the related DOM element:

Here is an example of how it can be implemented:

Thank you for your help. I really appreciate it. Recently, I encountered another problem, which is unloading gantt, entering the page, or refreshing. I don’t know how to deal with it. Do you have experience in this? By the way, this is a vue3 project. Here are the codes and errors


First, you need to make sure that your Gantt version allows you to create a new Gantt Instance when you open the page/tab with Gantt:

The Individual and GPL versions don’t have that feature. So if you destroy Gantt, you won’t be able to use it until you reload the page in the browser. In that case, you should use the alternative approach instead of destroying Gantt:

Here are the Vue3 demos:

Gantt Instance approach:

Alternative approach:

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 send me a ready demo so that I can reproduce the issue locally.

Hello, it was Gantt when it was introduced and Gantt when it was used Descrtutor, if you enter the page again, there will be an error. What’s the difference between the specific data reference you provided, instantiation and the direct use of this gantt? How to get the current gantt instance? When updating data, I will clear the data once, which is gantt. clearAll(). If you go to other pages, you can’t get the data processor to uninstall,
This is the file of the Gantt Chart page. I’ll show you the code directly. The data has a request interface
ProjectTrackGantt.vue (47.5 KB)
The following is a screenshot of this page:

In addition, there is a screenshot of an error. It is an error when parsing tasks again. I’m not sure what the reason is. Please help me analyze it. Thank you very much