How to disable drag duration as half of a day?

Hello,

In Gantt we could drag taskbar to edit startdate, enddate, and duration.

The default setting allow the taskbar could drag the duration as half of a day.

How to disable it to control the Gantt only allow draging taskbar's duration as full of a day?

Thanks

8 Replies

SR Suriyaprasanth Ravikumar Syncfusion Team January 12, 2018 10:52 AM UTC

Hi Jacob,  
 
We have analyzed your query, using the roundOffDuration event argument in “taskbarEditing” client side event it is possible to edit the tasks with 1/Full day precision in Gantt(1,2,3,4 days etc.,). This event will be triggered while editing the taskbar. Please refer the code snippet below to achieve this.                                                                                                                  
[HTML]  
       $(function () { 
            $("#GanttContainer").ejGantt({ 
                dataSource: defaultGanttData, 
                //.. 
                taskbarEditing: function(args){ 
               args.roundOffDuration = true; 
              } 
            }); 
        }); 
  
We have also prepared a sample for your reference, Please find the sample from the below location. 
 
Please let us know if require further assistance on this. 
 
Thanks, 
Suriyaprasanth R. 



JA Jacob January 15, 2018 01:31 AM UTC

Hello,

I follow your solution but not work.

I  use Syncfusion 15.4.0.17 with ASP.NET MVC framework.

And the code is:

@(Html.EJ().Gantt("Gantt")
//...
    .ClientSideEvents(eve =>
    {
        eve.TaskbarEditing("TaskbarEditing");
    })
//...
)

And the script function:

    function TaskbarEditing(args) {
        console.log(args);
        args.roundOffDuration = true;
    };

But I found the args content didn't exist the roundOffDuration attribute.

Is it something I missed?




JA Jacob January 15, 2018 01:37 AM UTC

This pics is the console args content.

Not found the roundOffDuration attribute.

I guess it's the reason why not working.

Attachment: Gantt_3da6c598.zip


JS Jonesherine Stephen Syncfusion Team January 15, 2018 12:48 PM UTC

Hi Jacob, 
We have analyzed the reported query. Duration rounding-off while editing taskbars has been implemented in v15.4.0.20. Can you please upgrade your current version to v15.4.0.20 to enable this feature. 
Please find the download link below: 
 
Please let us know if you need further assistance on this. 
Regards, 
Jone sherine P S 



JA Jacob January 16, 2018 06:57 AM UTC

Hello,

I already upgrade to the version 15.4.0.20.

This new pics file is the console args content, it's a few differences from the previous version

But the args content from TaskbarEditing event still not found the roundOffDuration attribute.

I create a new Syncfusion project with the version 15.4.0.20.

And there is mine test Gantt setting:

@(Html.EJ().Gantt("Proj_GanttEditor")
//...

    .ScheduleStartDate("02/01/2014")
    .ScheduleEndDate("03/14/2014")
    .DateFormat("MM/dd/yyyy")
    .AllowDragAndDrop(true)
    .ShowColumnChooser(false)
    .AllowSorting(false)
    .EnableProgressBarResizing(false)
    .EnableWBS(true)
    .IncludeWeekend(true)
    .ShowColumnOptions(true)
    .HighlightWeekends(true)
    .TreeColumnIndex(1)
    .ShowGridCellTooltip(true)
    .AllowGanttChartEditing(true)
    .AllowColumnResize(true)
    .EnableContextMenu(true)
    .TaskSchedulingMode(GanttTaskSchedulingMode.Manual)
    .IncludeWeekend(true)
    .ClientSideEvents(eve =>
    {
        eve.TaskbarEditing("TaskbarEditing");
    })
    .EditSettings(edit =>
    {
        edit.AllowAdding(true);
        edit.AllowDeleting(true);
        edit.AllowEditing(true);
        edit.AllowIndent(false);
        edit.EditMode("normal");
    })
    .IsResponsive(true)
    .EnableVirtualization(false)
    .SizeSettings(ss => ss.Width("100%").Height("600"))
    .DragTooltip(tooltip =>
    {
        tooltip.ShowTooltip(true);
    })

//...
)

Maybe I have some settings are not set ?

Thanks,

Best Regards.



Attachment: Gantt15_4_0_20_6f2be6b7.zip


SR Suriyaprasanth Ravikumar Syncfusion Team January 17, 2018 12:00 PM UTC

Hi Jacob, 
 
The event argument ‘roundOffDuration’ is available in the ‘taskbarEditing’ event, but it is not currently visible in the event argument list. You can use the event argument as said in our previous response and can define the Boolean values to toggle the round off values while editing the taskbars. We will resolve this argument listing issue in our upcoming 2018 volume 1 release. 
 
Please let us know if you require any other assistance on this.    
  
Regards,    
Suriyaprasanth R.   



JA Jacob January 18, 2018 02:51 AM UTC

Hello,

It worked well now, thanks!

I think maybe it could be set in Gantt setting not in TaskbarEditing event.

Best regards.


SR Suriyaprasanth Ravikumar Syncfusion Team January 18, 2018 11:26 AM UTC

Hi Jacob, 
 
Thanks for your update. As we said in previous response, the event argument ‘roundOffDuration’ is available in the ‘taskbarEditing’ event, but it is not currently visible in the event argument list. We will resolve this issue in our upcoming 2018 volume 1 release. 
 
Please let us know if you require any other assistance on this.    
  
Regards,    
Suriyaprasanth R.   


Loader.
Up arrow icon