주요 콘텐츠로 건너뛰기

edit-item

설명

인라인 편집기를 통해 태스크/프로젝트의 값이 편집될 때 발생합니다

사용법

"edit-item": ({
id: string | number,
currentValue: string
}) => void;

매개변수

edit-item 이벤트의 콜백은 다음 매개변수를 가진 객체를 받을 수 있습니다:

  • id - (필수) 태스크/프로젝트의 ID
  • currentValue - (필수) 태스크/프로젝트의 현재(저장되지 않은) 값
정보

내부 이벤트를 처리하려면 Event Bus 메서드를 사용할 수 있습니다

예제

const { ToDo, Toolbar } = todo;
const {tasks, projects, users} = getData();

const list = new ToDo("#root", {
tasks,
projects,
users
});

const toolbar = new Toolbar("#toolbar", {
api: list.api,
});

// "edit-item" 이벤트 구독
list.api.on("edit-item", ({id, currentValue}) => {
console.log("The current value of the", id, "item is", currentValue);
});

관련 문서: 인라인 편집