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

Gantt edit only relationships

Hi,

It's possible, when I edit a gantt, show only the tab with relationships. Or disable all other tabs.

Also, is it possible, in gantt editing, only add relationships? disable de capacity of extend the start/end date.

Thanks

7 Replies

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

Hi Manolo, 
In Gantt, it is possible to display only specific tabs in add/edit dialog using workaround with actionBegin client side event. This event will be triggered before opening of Add/Edit dialog with request types “openAddDialog” and “openEditDialog” for add and edit dialogs respectively. 
As we are using our ejTab control in the dialog box so, we can easily remove the tab using ejTab public method called as “removeItem”. 
@(Html.EJ().Gantt("GanttContainer") 
.ClientSideEvents(cs => 
                    { 
                        cs.ActionBegin("actionBegin"); 
                    }) 
//… 
function actionBegin(args){     
     
    if(args.requestType == "OpenAddDialog"){ 
        var tab = $("#GanttContainerAddTab").ejTab("instance"); 
        tab.removeItem(0); 
    } 
    else if(args.requestType == "openEditDialog"){ 
    var tab = $("#GanttContainerEditTab").ejTab("instance"); 
    tab.removeItem(0); 
    } 
  } 
 
As we are removing rendered tab with mapping fields. Hence, we may cause some exceptions. To avoid those exceptions, we have to skip the other tab fields in add/edit dialog. 
For that we have to use the APIs “AddDialogFields & EditDialogFields” to customize required dialog fields. Hence, we have to add only predecessMapping field and it will skip the other tab fields in the dialog. 
@(Html.EJ().Gantt("GanttContainer") 
//… 
.AddDialogFields(ad => 
            { 
                ad.Field("Predecessor").Add(); 
            }) 
            .EditDialogFields(ed => 
            { 
                ed.Field("Predecessor").Add(); 
            }) 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if your require any other assistance on this. 
Regards, 
Jayakumar D 



MA Manolo August 2, 2017 01:17 PM UTC

In my code, when I try save the predecessor relationships in form I get a javascript error when I click on save.


I'm using version 15.2.0.40




JD Jayakumar Duraisamy Syncfusion Team August 3, 2017 11:10 AM UTC

Hi Manolo, 
We regret for the inconvenience caused. 
We can able to replicate the reported issue, this issue is occurred due to removal of  the general tab in add/edit dialog. And this issue occurred only when we referred jQuery validation file in project. 
We would like to suggest you that hide the tabs instead of remove it. 
Please refer the code snippet as below, 
@(Html.EJ().Gantt("GanttContainer") 
//… 
.ClientSideEvents(cs => 
                    { 
                        cs.ActionBegin("actionBegin"); 
                    }) 
            .AddDialogFields(ad => 
            { 
                ad.Field("Predecessor").Add(); 
            }) 
            .EditDialogFields(ed => 
            { 
                ed.Field("Predecessor").Add(); 
            }) 
) 
 
<script type="text/javascript"> 
 
    function actionBegin(args){     
     
    if(args.requestType == "OpenAddDialog"){ 
        var tab = $("#GanttContainerAddTab").ejTab("instance"); 
    tab.option("hiddenItemIndex", [0]); // Hide tabs 
   } 
    else if(args.requestType == "openEditDialog"){ 
    var tab = $("#GanttContainerEditTab").ejTab("instance"); 
    tab.option("hiddenItemIndex", [0]); // Hide tabs 
 
    } 
    } 
    </script> 
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 on this. 
Regards, 
Jayakumar D 



MA Manolo August 4, 2017 06:43 AM UTC

Thanks a lot!



JD Jayakumar Duraisamy Syncfusion Team August 7, 2017 04:07 AM UTC

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



MA Manolo November 14, 2017 11:43 AM UTC

Hi again,

I've another problem.

In my gantt, I've enabled AllowGanttChartEditing, so, the user can set relationships, resize the task size (duration) and move the task (change the start date).

But now, I need separate permissions, some users only can create relationships but NOT resize or move the task bar and other users inverse.

When I AllowGanttChartEditing, the user can do it all.

How can I do that the user only set relationships, not change taskbar and vice versa?


Thanks




SR Suriyaprasanth Ravikumar Syncfusion Team November 15, 2017 12:45 PM UTC

Hi Manolo, 
 
At present there is no support to prevent particular action on taskbar editing action and we have logged a feature report for this. 
And also we have created a support incident under your account to track the status of this feature. 
 
Please log on to our support website to check for further updates. 
 
Please let us know if you require further assistance on this. 
 
Thanks,  
Suriyaprasanth R. 


Loader.
Up arrow icon