RadiantQ jQuery Gantt Package
How to indent/outdent multiple tasks?
Previous Topic  Next Topic 


In some cases we wanted to indent one or more tasks to the same indent level, multiple indent can be used. Below code illustrated the multiple indent and outdent.


// Indent the selected tasks, to make it as children.

$("#indent").click(function () {

    var activityviews = ganttControl.SelectedItems;

    if (activityviews.length > 0) {

        for (var i = 0; i < activityviews.length; i++) {

            var activityview = activityviews[i];

            if (ganttControl.CanIndent(activityview) == true)

                ganttControl.Indent(activityview);

        }

    }

    else

        alert("Please select an item in the table first.");

    return false;

});


// Outdent the selected tasks.

$("#outdent").click(function () {

    var activityviews = ganttControl.SelectedItems;

    if (activityviews.length > 0) {

        for (var i = 0; i < activityviews.length; i++) {

            var activityview = activityviews[i];

            if (activityview.activity._indentLevel != 0)

                ganttControl.Outdent(activityview);

        }

    }

    else

        alert("Please select an item in the table first.");

    return false;

});



Note : By default, the first of selected tasks will be indented/outdented.



� RadiantQ 2022. All Rights Reserved.