onBeforeBranchLoading

if dynamic loading is enabled, fires after a user expands the task branch but before loading starts

boolean onBeforeBranchLoading(object settings);
settingsobjectan object which contains the task id and request URL
booleanreturning `false` will cancel the dynamic loading and the data request won't be sent to the server

Available only in PRO Edition

Example

gantt.attachEvent("onBeforeBranchLoading", function(settings){
    var task = gantt.getTask(settings.taskId);
    config.url += "&value=" + encodeURIComponent(task.text);
    return true;
});

Details

This event can be used to add extra parameters to dynamic loading requests. The settings object contains two properties - the id of the task and the request url:

{
   taskId: 1,
   url:"/data?parent_id=1"
}

The request url can be modified from code.

This event fires only when Dynamic loading is enabled.

The event is blockable, returning false will cancel the dynamic loading request.

See also
Back to top