RadiantQ jQuery Gantt Package
How to remove a dependency?
Previous Topic  Next Topic 

How to remove a dependency?


1) How to delete the dependency, knowing it's instance itself?


// Removing dependency by instance.

ganttControl.Model.Dependencies.remove(dependency);



2) How to remove all dependencies for a specific Activity?


This API removes all the dependencies where the activity is a predecessor or a successor.

// Removing all dependencies of activity.

ganttControl.Model.Dependencies.removeDependenciesOf(activity);



3) Given the from and to activity ids, how to remove their dependency if any?


// Get predecessor dependencies by to activity.

var preds = ganttControl.Model.Dependencies.GetPredecessors(toAct);

// Get successor dependencies by from activity.

var succs = ganttControl.Model.Dependencies.GetSuccessors(fromAct);


var intersectDeps = preds.filter(function (n) {

    return succs.indexOf(n) != -1

});

if (intersectDeps.length > 0) {

    // Removing the dependency.

    ganttControl.Model.Dependencies.remove(intersectDeps[0]);

}




� RadiantQ 2022. All Rights Reserved.