Search results

Comments in JavaScript (ES5) DocumentEditor control

15 Oct 2021 / 1 minute to read

Document Editor allows you to add comments to documents. You can add, navigate and remove comments in code and from the UI.

Add a new comment

Comments can be inserted to the selected text.

Copied to clipboard
//Add new commnt in the document.
documentEditor.editor.insertComment("Test comment");

Comment navigation

Next and previous comments can be navigated using the below code snippet.

Copied to clipboard
//Navigate to next comment
documentEditor.selection.navigateNextComment();

//Navigate to previous comment
documentEditor.selection.navigatePreviousComment();

Delete comment

Current comment can be be deleted using the below code snippet.

Copied to clipboard
//Delete the selected comment.
documentEditor.editor.deleteComment();

Delete all comment

All the comments in the document can be deleted using the below code snippet.

Copied to clipboard
//Delete all the comments present in the current document.
documentEditor.editor.deleteAllComments();