Hello, I am working with Gantt component. In the picture below I schedule all task by using Schedule button and I set start date as 13/09/2024 and I use Next Day button, all operations datas are setted 14/09/2024 its true but the task data which is depentent one is setted 15/09/2024 its wrong.
If third and forth data is dependent to previous task the they are also setted wrong date. third one is setted as 16/09/2024 last one would be 17/09/2024. But I want to see all data as 14/09/2024.
What should I do? What is the working principle of the gantt? Can we change it? Thanks.
Hi Emrah,
Greetings from Syncfusion!
Thank you for reaching out with your query regarding the Gantt component.
To clarify, the behavior you're seeing—where tasks after "14/09/2024" are scheduled for later dates—is due to the Gantt Chart's dependency validation. This is the expected behavior when dependencies are defined between tasks. However, if you'd like the tasks to follow the exact start dates provided in the data source without dependency-based adjustments, we recommend using the autoCalculateDateScheduling API.
Code-Snippet:
<GanttComponent autoCalculateDateScheduling={false} > |
You can see the adjusted behavior by clicking the "Change startDate" button in the sample provided below. Keep in mind, with this API enabled, the Gantt chart will display tasks exactly as they are in the data source, without considering task dependencies.
Sample - Q4smj2 (forked) - StackBlitz
Documentation - Task dependency in React Gantt component | Syncfusion
If we misunderstood your query, share more details like Screenshot/ Code example that you have performed on button click to proceed further.
Note: - We are unable to find the attachment that you have shared.
Best regards,
Sridharan
Hi, the problem is when I schedule the parent note by clicking next date, the task's dates are setted as in the below. I expect to see all dates are 22/09/2024 but dates are setted like 22, 23, 24, 25. I dont want it. I think its a Gantt behavior
<GanttComponent
autoCalculateDateScheduling={false} > this is a not solution for me.
Thank you.
Hi Emrah,
For your query, we recommend using the enablePredecessorValidation API and setting it to false to prevent the dependency validation. This will meet your requirement. After doing this, changing the parent task’s start date will update all child tasks to the same date. Please refer to the code snippet below:
enablePredecessorValidation={false} |
Modified Sample - Q4smj2 (forked) - StackBlitz
Regards,
Sridharan
Hi,
I applied your solution then the dates are same but time not calculated properly. I show the expected time with yellow text in the below.
What should I do? I still think the feature is related with the gantt component becasue I didnt play with the data to change dates.
Thank you.
Hi,
When I add this code in the below, dates are being calculeted as expected but now I see a spinner and the spinner doesnt dissappear. It seems a solution but I think I use this in a wrong way because I see spinner all the time.
I still dont understand why dates are setted wrong before I do that. Thank you.
Emrah,
For your query, kindly ignore all our previous updates suggested. Now you can simply add time to your startDate in the datasource which will work as you expected. change the parent's start date and ensure does the solution meet your requirement. Refer code snippet for your reference.
Code-Snippet:
data.js:- { TaskID: 2, TaskName: 'Identify site location', StartDate: new Date('04/02/2024 08:00:00'), Duration: 1, Progress: 30, resources: [1], info: 'Measure the total property area alloted for construction', }, index.js:- <GanttComponent dateFormat={'MMM dd, y ,hh,mm'} > |
Modified Sample - https://stackblitz.com/edit/react-uvxq74-adtjha?file=index.js,data.js
Regards,
Sridharan
Hi, it doesnt work for me. I record a video. https://youtu.be/f4TwQh9hpwE
Maybe there is a unit inconsistency in the gantt, we usually use Hour Unit. Hope the video is usefull to investigate the issue. I shared my gantt before, if you want to see any part of the code I will share it,
Thank yo
Emrah,
Based on your shared details, we tried to replicate the issue but were unable to reproduce it. We have prepared a sample using updateRecordById method to update the start date of the parent task with external button click, and the issue did not occur.
To assist you further, please provide the following details:
Sample - https://stackblitz.com/edit/react-uvxq74-3yskye?file=index.js