Create tasks by setting two fields between start date, end date and duration

Hi,

I am currently creating tasks by setting start and end dates.

I was wondering if it would be possible to introduce a duration field and then I could choose if using the dates or one date and the duration.

Would it be possible to add the duration field in the dialog, on which I will compute the other date?

I tried adding the field but I got errors, I think because it doesn't exist in my task class.

How could I add an input in the dialog and before hitting save, it will compute the missing date?

Would it be possible to hide/show inputs by pressing a button? I was thinking of inserting three buttons: Start/End date, Start+duration and End+Duration.

Thank you.

Best regards,

Matteo Messmer


3 Replies 1 reply marked as answer

GM Gopinath Munusamy Syncfusion Team September 12, 2022 01:51 PM UTC

Hi Matteo,


We have checked your query, as per your requirement you can able to add the duration field in the dialog by including the duration inside the taskFields. We have attached the sample for your reference. If your requirement is to customize the dialog between any of the three fields, we request you to share below details, which will be useful for us to provide you with a better solution.

  1. If buttons are required to select between either of the two fields, could you kindly specify whether they should be added inside the dialog or outside the Gantt?
  2. Whether you want to calculate the duration value manually without including the duration field inside the taskFields?


Sample: https://stackblitz.com/edit/react-68lzcz?file=index.js


Regards,

Gopinath.


Marked as answer

MA matteomessmer September 12, 2022 04:00 PM UTC

Oh thank you. It was the allowUnscheduledTask that made the difference.

Best regards,

Matteo Messmer



GM Gopinath Munusamy Syncfusion Team September 13, 2022 05:49 AM UTC

Hi Matteo,

You’re most welcome. Please get back to us if you require any further assistance.

Regards,

Gopinath.


Loader.
Up arrow icon