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

Working with Task and Child Task

I have some question regarding the GantControl

I have created a small program where I am able to save, update, delete and load data back out of the DB.
But Iam struggeling with the child part.

1.
I can make a task to a child if I use the indent, then the tree on the left side will show it as well.
I can see that by upding the childtask will get the ParentId which is saved during the update to DB.
If I now load back the data, the Tree will not be shown as it should, I add some pictures what I mean.

2.
If I press the add button, how can I archieve that this task will be per now a child task?


Best Regards
Martin


Attachment: Pictures_1fb7aeee.zip

1 Reply

JD Jayakumar Duraisamy Syncfusion Team July 25, 2017 01:25 PM UTC

Hi Martin, 
Please find the response below, 
Query 1: I can make a task to a child if I use the indent, then the tree on the left side will show it as well. If I now load back the data, the Tree will not be shown as it should, I add some pictures what I mean. 
Answer: We have analyzed the reported issue in our sample but unable to reproduce it. Hence, we have prepared a sample to preform indent/outdent operations and please ensure that the new parentId value properly updated in the table of parentId mapping column. 
Also, ensure that the following code snippet, 
if (args.requestType === 'outdent' || args.requestType === 'indent' || args.requestType === 'recordUpdate') { 
                    var ganttRec = args.data.item; 
                    PageMethods.UpdateIt(ganttRec); 
                } 
 
Query 2: If I press the add button, how can I archieve that this task will be per now a child task? 
Answer: In Gantt EditSettings, have an API called RowPosition. By using this API, we can set the newly inserted record position as Top, Bottom, Above, Below, Child. Hence, set RowPosition as ‘Child’ then new added record will be inserted as child record of selected item. 
<ej:Gantt ID="Gantt"  
//… 
<EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" AllowIndent="true" EditMode="normal" RowPosition="Child" /> 
 
Please find the sample location as below, 
If you are facing the same issue again, please revert us with modified sample which can able to reproduce the issue. It will help us to serve you better. 
Regards, 
Jayakumar D 


Loader.
Up arrow icon