getAPIModelById
2.11.0 버전부터 지원합니다.
ID로 요소를 찾아, API로 편집할 수 있는 API 모델(APIModel)을 반환합니다.
매개변수
| 이름 | 타입 | 설명 |
|---|
id | string | 요소 id |
[options] | object | { skipUndoRedo: false, skipRendering: false } |
options
| 이름 | 타입 | 기본값 | 설명 |
|---|
skipUndoRedo | boolean | false | true일 때, 이 모델을 통한 편집은 실행 취소/다시 실행 스택에 추가되지 않습니다. 기존 실행 취소/다시 실행 스택도 초기화됩니다. |
skipRendering | boolean | false | true일 때, 편집은 모델에만 적용되고 렌더링되지 않습니다. 모든 편집 후, 별도로 editor.render()를 호출해야 합니다. |
반환값
예시
var table = editor.getAPIModelById('ID');
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
var table = editor.getAPIModelById('ID', { skipUndoRedo: true });
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
var table = editor.getAPIModelById('ID', { skipRendering: true });
table.insertCol(1);
table.insertRow(1);
table.setWidth(400);
editor.render();