본문으로 건너뛰기

getItem()

설명

id로 항목의 객체를 반환합니다

사용법

getItem(id: string | number): object;

매개변수

  • id - (필수) 선택한 항목의 id

반환값

이 메서드는 항목의 객체를 반환합니다

예제

const diagram = new dhx.Diagram("diagram_container", {
type: "default"
});
diagram.data.parse(data);

const shape = diagram.data.getItem(123);

다음과 같이 항목의 원래 속성에 접근할 수 있습니다:

// shape의 속성에 접근
const shape = diagram.data.getItem(123);
const text = shape.text;

관련 문서: 항목 가져오기