Disable modification to a Task

Hello,

What I would like to achieve is : 
1 - Disable the modification of certain tasks only.
2 - The other tasks stay editable and any modification applyed to these tasks don't have any impact to the tasks that are not editable.

Any idea to achieve this behaviour ?

Regards,
Mamy

5 Replies 1 reply marked as answer

GM Gopinath Muniraj Syncfusion Team July 17, 2020 01:27 AM UTC

Hi Mamy, 
Thanks for contacting Syncfusion support. 
We need some clarification regarding your query, 
1.      A task can be restricted from editing by using actionBegin event, 
Please find the below code snippet, 
 
app.html 
<ej-gantt id="GanttControl"  
            (actionBegin)="actionBegin($event)" 
</ej-gantt> 
 
app.component.ts 
actionBegin(args) { 
    if (args.requestType == 'openEditDialog') { 
       if (args.data.item.taskid == 4) { 
         args.cancel = true; 
       } 
    } 
             } 
 
 
2.      But in the second query you have asked, that non-editable task should not get edited while editing another task. 
 
·       Let assume, that non editable record with ID= ‘4’ is having predecessor 3FS. 
·       If we are changing the start date of record with ID= ‘3’, the non-editable record also will tend to change. 
·       In this case, if you need to restrict the complete editing or else changes of that non-edit task alone? 
 
Can you please let us know, what kind of customization you require in this scenario?  It will be more helpful for us to achieve your required solution asap. 
Thanks, 
Gopinath M 



RM RAKOTONINDRINA MAMY July 17, 2020 07:03 AM UTC

Hello,

1 - Disable the modification of certain tasks only : it works, thank you.
2 - For the second question, the scenario is like this :
     - In my code, I have some condition that tels if a task is completed or not.
     - Once a task is completed, the stratDate and the endDate cannot be changed anymore.
     - Let assume that the record with ID='4' is completed and thus non editable.
     - The record with ID='4' have a predecessor 3FS-3 days.
     - The record with ID='3' is not completed yet and is still editable.
     - My requirement is that even if we change the endDate of task with ID='3', it will not change the startDate of task with ID='4'. Il will only change the relationship between them. 
     - For example, if I add 3 days to the duration of task with ID='3', the record with ID='4' will have a predecessor 3FS-6 days. And the startDate of record with ID='4' will stay the same.

Thanks,
Mamy


MS Monisha Sivanthilingam Syncfusion Team July 21, 2020 09:38 AM UTC

Hi Mamy, 
 
We can disable the modification of a task using the validateLinkedTask request type in actionBegin event. The following code snippet demonstrated how to achieve this. 
 
app.component.ts 
 

actionBegin: function (args) { 
            if (args.requestType == 'validateLinkedTask') { 
                if (args.data.Predecessor) { 
                    args.cancel = true; 
                } 
            } 

 
app.html 
 

<ej-gantt id="GanttControl"   
            (actionBegin)="actionBegin($event)"  
</ej-gantt> 

 
This is the solution to generally disable the modification of linked tasks. 
 
However, we would like to know a few more details in order to achieve the result you requested. We would like to know based on what criteria do you make a task to be non-editable ? This would be very helpful to us in proceeding further. 
 
Regards, 
Monisha 


Marked as answer

RM RAKOTONINDRINA MAMY July 22, 2020 10:39 AM UTC

Hello,

The information you provided are enough to develop our requirements.

Thank you,
Mamy


MS Monisha Sivanthilingam Syncfusion Team July 23, 2020 09:23 AM UTC

Hi Mamy, 
 
You are welcome. 
 
We are glad to know that the provided information was useful. Please contact us if you require any further assistance. 
 
Regards, 
Monisha. 


Loader.
Up arrow icon