We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Shifting task with his predecessors on gantt chart

Hello,

I've got an issue with shifting task and its predecessors on Gantt chart. I would like predecessors to shift along when the task gets prolonged or moved in time.
I have already tried using property 'enablePredecessorValidation', but it solves my problem only partially, because when task gets prolonged the gap between the task and predecessor is first taken, then predecessors are moved.
I would like to keep the gap untouched.


Regards,
Karol

3 Replies

SR Suriyaprasanth Ravikumar Syncfusion Team August 23, 2017 11:02 AM UTC

Hi Karol, 
We can able to maintain the gap between the two tasks which are connected by predecessor by providing ”offset” value to the predecessor. 
Please refer this link to know more details about predecessor offset. 
We have modified the provided sample, please refer following code snippet,  
 
$("#GanttContainer").ejGantt({ 
                "dataSource": [ 
   { 
      //..    
          { 
              "id": 4183, 
              //.. 
              "predecessors": "4184FS+10d,4185FS" 
          }, 
          { 
              "id": 4182, 
              //.. 
              "predecessors": "4183FS+4d" 
          }, 
       //..  
   } 
                ], 
       //.. 
}); 
 
We can also use validation dialog to validate the predecessor link manually. If the user moved the successor task the dialog will be rendered with below options, 
  • Cancel, Keep the existing link
  • Remove the link and move the task to start on edited date.
  • Move the task to start on edited date and keep the link.
Refer this link to know further details about predecessor validation dialog. 
Please refer following code snippet to enable predecessor validation dialog, 
 
$("#GanttContainer").ejGantt({ 
 
                //.. 
 
                "actionBegin": "actionBegin" 
            }); 
<script> 
        function actionBegin(args) { 
            if (args.requestType == "validateLinkedTask") { 
                args.validateMode.preserveLinkWithEditing = false; 
            } 
        } 
    </script> 
 
We have modified the provided sample, please find the sample location below. 
Please let us know if require further assistance on this. 
 
Thanks, 
Suriyaprasanth R. 



KW Karol Wlodarek August 28, 2017 07:57 AM UTC

Hi, 

Thanks for Your reply. The answer is helpful, but I need one more thing.

Is it possible to compute the offset when I load Gantt chart for the first time?

Regards,
Karol


SR Suriyaprasanth Ravikumar Syncfusion Team August 29, 2017 12:31 PM UTC

Hi Karol, 
As per the current behavior tasks date values are validated according to predecessor and it’s offset value in data source. 
It is not possible to compute the offset value in Gantt at initial load time. There is only option to provide necessary offset value in data source before load into the Gantt. 
Please let us know if you require any other assistance on this. 
 
Thanks, 
Suriyaprasanth R. 


Loader.
Live Chat Icon For mobile
Up arrow icon