Skip to main content

onBeforeBranchLoading

Description

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

onBeforeBranchLoading: (settings: any) => boolean;

Parameters

  • settings - (required) object - an object which contains the task id and request URL

Returns

  • result - (boolean) - returning false will cancel the dynamic loading and the data request won't be sent to the server

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.