Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeEmacs
title에디터 설정
// SEModel(json 타입)로 에디터 열기
window.editor = new SynapEditor(editorId, that.editorConfig);
window.editor.openSEModel(json); // db에서 꺼내온 json
var documentComparisonPlugin = window.editor.plugins.documentComparison;
if (documentComparisonPlugin) {
    documentComparisonPlugin.addListParam('docId', docId); // addListParam: 문서이력 목록조회 API(ex:'/getDocumentVersionList')의 param을 추가합니다.
}

// 모델로 저장하기
var json = window.editor.getBodyModelJSON(true);
// 저장하는 API로 json을문서 이력 데이터 저장 API(ex:/saveDocumentVersionData)로 json(SEModel: 에디터모델)을 전송해서 저장하게 해야 함