본문으로 건너뛰기

onBeforeBranchLoading

Description

동적 로딩이 활성화된 경우, 사용자가 작업 분기를 확장한 후 로딩이 시작되기 전에 발생합니다

onBeforeBranchLoading: (settings: any) => boolean;

Parameters

  • settings - (required) object - 태스크 ID와 요청 URL을 포함하는 객체

Returns

  • result - (boolean) - 반환 값이 false인 경우 동적 로딩이 취소되고 데이터 요청은 서버로 전송되지 않습니다

Example

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

Details

이 이벤트는 동적 로딩 요청에 추가 파라미터를 넣을 때 유용합니다. settings 객체는 작업 ID와 요청 URL 두 가지 속성을 포함합니다:

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

코드 내에서 요청 URL을 직접 수정할 수 있습니다.

이 이벤트는 Dynamic loading이 활성화된 경우에만 발생합니다.

이벤트를 차단할 수도 있으며, false를 반환하면 동적 로딩 요청이 취소됩니다.

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.