본문으로 건너뛰기

afterItemCatch

설명

항목이 캡처된 후 발생합니다

정보

이 이벤트는 Diagram의 조직도mindmap 모드에서만 작동하며, itemsDraggable 속성이 true로 설정되어 있어야 합니다.

사용법

"afterItemCatch": ({
id: string | number,
targetId: string | number,
batch: (string | number)[],
event: PointerEvent
}) => void;

매개변수

이벤트 콜백은 다음 매개변수를 포함하는 객체와 함께 호출됩니다:

  • id - 이동된 항목의 id
  • targetId - 대상 항목의 id
  • batch - 이동된 요소들의 id 배열
  • event - 이벤트 객체

예제

// Diagram Editor 초기화
const editor = new dhx.DiagramEditor("editor_container");
// 데이터 로드
editor.parse(data);

// 이벤트에 핸들러 연결
editor.events.on("afterItemCatch", ({ id, targetId }) => {
console.log(`
item ${id} is caught by the item ${targetId}
`);
});

변경 로그:

  • batch 매개변수는 v6.0에서 추가되었습니다
  • 콜백 함수는 v6.0부터 매개변수로 객체를 받습니다