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

Task Relationship persist data

Hi,

I've a gantt, and I have doubts:

1. How can I set the relationships?

In gantt sample creator the relationship are defined these:
new GanttFeatureData()
                        {
                            Id = 3,
                            Name = "Child Task 2",
                            StartDate = "02/26/2014",
                           BaselineStartDate = "02/26/2014",
                             BaselineEndDate = "02/29/2014",
                            Duration = 3,
                            PercentDone = 40,
                            Predescessor = "2FS"
                        },

I think that relationships are defined by string composite in this way:

ID + Type Relationsip (SS or SF or FS or FF)

It's correct?

And how I can set offset days?

2. In gantt diagram...when I set relationship with doing drag&drop (without form) how can I save data in my database?

Thanks


3 Replies

JD Jayakumar Duraisamy Syncfusion Team July 19, 2017 12:54 PM UTC

Hi Manolo, 
Please find the response below. 
Query 1: How can I set the relationships? I think that relationships are defined by string composite in this way:
ID + Type Relationsip (SS or SF or FS or FF)
 
Answer: Yes, we have set the relationships with TaskIdMapping field value. 
Query 2:  how I can set offset days? 
Answer: Please refer following help documentation link to more about Predecessor offset. 
Query 3:  In gantt diagram...when I set relationship with doing drag&drop (without form) how can I save data in my database? 
Answer: In the ActionComplete event will be trigger with request type of recordUpdate, once the relationship has linked. We will also get the updated record from the argument. By using Ajax call request, we can pass the updated record to the server side for data base update. 
Please refer following code snippet, 
@(Html.EJ().Gantt("Gantt"). 
.ClientSideEvents(eve => 
        { 
         eve.ActionComplete("actionComplete"); 
} 
//…. 
function actionComplete(args) {            
 
            //To update on indent,outdent and taskbar editing action 
            if (args.requestType == "indent" || args.requestType == "outdent" || args.requestType == "recordUpdate") { 
                var data = $.extend({}, true, args.data.item);                 
                $.ajax({ 
                    type: "POST", 
                    url: '/Gantt/Update', 
                   contentType: "application/json; charset=utf-8", 
                    data: JSON.stringify(data), 
                    dataType: "json", 
                }); 
            } 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if you require any other assistance. 
Regards, 
Jayakumar D 



MA Manolo July 26, 2017 09:15 AM UTC

Thanks!



JD Jayakumar Duraisamy Syncfusion Team July 27, 2017 04:27 AM UTC

Hi Manolo, 
Thanks for the update. 
Regards, 
Jayakumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon