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.
Unfortunately, activation email could not send to your email. Please try again.

Overriding task progress of gantt with custom

Thread ID:

Created:

Updated:

Platform:

Replies:

129295 Mar 10,2017 12:27 AM Mar 13,2017 03:07 PM JavaScript 1
loading
Tags: ejGantt
Nivedita Vijaivergiya
Asked On March 10, 2017 12:27 AM

Hi,
Currently Gantt calculate parent task progress according to its child task. But i want assign progress to every level task on the basis of calculation done by us(according to our logic).

How can i override gantt calculation for progress?

Thanks,
Nivedita

Jonesherine Stephen [Syncfusion]
Replied On March 13, 2017 03:07 PM

Hi Nivedita, 
During load time we can render Gantt with custom progress logic by using “load” and create client side event. Using actionComplete client side event we can update custom progress on add/edit/delete action. 
Please find the code example below: 
$("#GanttContainer").ejGantt({ 
actionComplete: function (args) { 
                    //To update the parent fields on edit action 
                    if (args.requestType == "recordUpdate" && !progressEdit) {                        
                        update(args.data.parentItem); 
                    } 
                    //To update the parent fields on add action 
                    if (args.requestType == "save" && args.addedRecord) {                         
                        update(args.addedRecord.parentItem); 
                    } 
                    //To update the parent fields on delete action 
                    if (args.requestType == "delete") { 
                        update(args.data.parentItem); 
                    } 
 
                }, 
}); 
      function update(parentItem) {           
            if (parentItem != null) { 
                //custom logic for parent item 
              parentItem.status = Math.round(parentItem.status +2); 
              parentItem.progressWidth = (parentItem.width * parentItem.status) / 100; 
              var ganttObj = $("#GanttContainer").data("ejGantt"); 
              treeGridObj = ganttObj._$treegridHelper.data("ejTreeGrid"); 
              ganttChartObj = ganttObj._$ganttchartHelper.data("ejGanttChart"); 
                ganttChartObj.refreshRow(ganttChartObj.model.updatedRecords.indexOf(parentItem)); 
                treeGridObj.refreshRow(treeGridObj.model.updatedRecords.indexOf(parentItem)); 
                return update(parentItem.parentItem); 
            } 
        }      
We have prepared the sample and rendered Gantt with custom progress. Please find the sample from below location 
If you are facing any issues while rendering Gantt with your custom progress logic kindly revert us with your exact requirement. This would be helpful for us to serve you better. 
Regards, 
Jone sherine P S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;