Skip to content

Commit 5883c49

Browse files
Added the API documentation for insert comments
1 parent 3a3da28 commit 5883c49

File tree

3 files changed

+28
-47
lines changed

3 files changed

+28
-47
lines changed

ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/razor

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,9 @@
88
container = documenteditorElement.ej2_instances[0];
99
documenteditor = container.documentEditor;
1010
let mentionData = [
11-
{ "Name": "Selma Rose", "Eimg": "3", "EmailId": "selma@mycompany.com" },
12-
{ "Name": "Russo Kay", "Eimg": "8", "EmailId": "russo@mycompany.com" },
13-
{ "Name": "Camden Kate", "Eimg": "9", "EmailId": "camden@mycompany.com" },
14-
{ "Name": "Mary Kate", "Eimg": "4", "EmailId": "marry@mycompany.com" },
15-
{ "Name": "Ursula Ann", "Eimg": "2", "EmailId": "ursula@mycompany.com" },
16-
{ "Name": "Margaret", "Eimg": "5", "EmailId": "margaret@mycompany.com" },
17-
{ "Name": "Laura Grace", "Eimg": "6", "EmailId": "laura@mycompany.com" },
18-
{ "Name": "Robert", "Eimg": "8", "EmailId": "robert@mycompany.com" },
19-
{ "Name": "Albert", "Eimg": "9", "EmailId": "albert@mycompany.com" },
20-
{ "Name": "Michale", "Eimg": "10", "EmailId": "michale@mycompany.com" },
21-
{ "Name": "Andrew James", "Eimg": "7", "EmailId": "james@mycompany.com" },
22-
{ "Name": "Rosalie", "Eimg": "4", "EmailId": "rosalie@mycompany.com" },
23-
{ "Name": "Stella Ruth", "Eimg": "2", "EmailId": "stella@mycompany.com" },
24-
{ "Name": "Richard Rose", "Eimg": "10", "EmailId": "richard@mycompany.com" },
25-
{ "Name": "Gabrielle", "Eimg": "3", "EmailId": "gabrielle@mycompany.com" },
26-
{ "Name": "Thomas", "Eimg": "7", "EmailId": "thomas@mycompany.com" },
27-
{ "Name": "Charles Danny", "Eimg": "8", "EmailId": "charles@mycompany.com" },
28-
{ "Name": "Daniel", "Eimg": "10", "EmailId": "daniel@mycompany.com" },
29-
{ "Name": "Matthew", "Eimg": "7", "EmailId": "matthew@mycompany.com" },
30-
{ "Name": "Donald Krish", "Eimg": "9", "EmailId": "donald@mycompany.com" },
31-
{ "Name": "Yohana", "Eimg": "1", "EmailId": "yohana@mycompany.com" },
32-
{ "Name": "Kevin Paul", "Eimg": "10", "EmailId": "kevin@mycompany.com" },
33-
{ "Name": "Andrew Fuller", "Eimg": "3", "EmailId": "andrew@mycompany.com"}
11+
{ "Name": "Mary Kate", "EmailId": "marry@company.com" },
12+
{ "Name": "Andrew James", "EmailId": "james@company.com" },
13+
{ "Name": "Andrew Fuller", "EmailId": "andrew@company.com"}
3414
];
3515
container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }};
3616
}

ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/tagHelper

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,9 @@
99
container = documenteditorElement.ej2_instances[0];
1010
documenteditor = container.documentEditor;
1111
let mentionData = [
12-
{ "Name": "Selma Rose", "Eimg": "3", "EmailId": "selma@mycompany.com" },
13-
{ "Name": "Russo Kay", "Eimg": "8", "EmailId": "russo@mycompany.com" },
14-
{ "Name": "Camden Kate", "Eimg": "9", "EmailId": "camden@mycompany.com" },
15-
{ "Name": "Mary Kate", "Eimg": "4", "EmailId": "marry@mycompany.com" },
16-
{ "Name": "Ursula Ann", "Eimg": "2", "EmailId": "ursula@mycompany.com" },
17-
{ "Name": "Margaret", "Eimg": "5", "EmailId": "margaret@mycompany.com" },
18-
{ "Name": "Laura Grace", "Eimg": "6", "EmailId": "laura@mycompany.com" },
19-
{ "Name": "Robert", "Eimg": "8", "EmailId": "robert@mycompany.com" },
20-
{ "Name": "Albert", "Eimg": "9", "EmailId": "albert@mycompany.com" },
21-
{ "Name": "Michale", "Eimg": "10", "EmailId": "michale@mycompany.com" },
22-
{ "Name": "Andrew James", "Eimg": "7", "EmailId": "james@mycompany.com" },
23-
{ "Name": "Rosalie", "Eimg": "4", "EmailId": "rosalie@mycompany.com" },
24-
{ "Name": "Stella Ruth", "Eimg": "2", "EmailId": "stella@mycompany.com" },
25-
{ "Name": "Richard Rose", "Eimg": "10", "EmailId": "richard@mycompany.com" },
26-
{ "Name": "Gabrielle", "Eimg": "3", "EmailId": "gabrielle@mycompany.com" },
27-
{ "Name": "Thomas", "Eimg": "7", "EmailId": "thomas@mycompany.com" },
28-
{ "Name": "Charles Danny", "Eimg": "8", "EmailId": "charles@mycompany.com" },
29-
{ "Name": "Daniel", "Eimg": "10", "EmailId": "daniel@mycompany.com" },
30-
{ "Name": "Matthew", "Eimg": "7", "EmailId": "matthew@mycompany.com" },
31-
{ "Name": "Donald Krish", "Eimg": "9", "EmailId": "donald@mycompany.com" },
32-
{ "Name": "Yohana", "Eimg": "1", "EmailId": "yohana@mycompany.com" },
33-
{ "Name": "Kevin Paul", "Eimg": "10", "EmailId": "kevin@mycompany.com" },
34-
{ "Name": "Andrew Fuller", "Eimg": "3", "EmailId": "andrew@mycompany.com"}
12+
{ "Name": "Mary Kate", "EmailId": "marry@company.com" },
13+
{ "Name": "Andrew James", "EmailId": "james@company.com" },
14+
{ "Name": "Andrew Fuller", "EmailId": "andrew@company.com"}
3515
];
3616
container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }};
3717
}

ej2-asp-core-mvc/document-editor/comments.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,28 @@ Document editor allows to add comments to documents. You can add, navigate and r
1818
Comments can be inserted to the selected text.
1919

2020
```typescript
21-
documentEditor.editor.insertComment("Test comment");
21+
documentEditor.editor.insertComment('Test comment');
22+
```
23+
24+
## Add a New Comment with Date, Author, and Status
25+
26+
Comments can be inserted into the selected text with a specified date, author, and status.
27+
28+
```typescript
29+
// In this example, a comment with the text "Nancy Davolio" is added by the author Rachel Green on July 23, 2024, at 2:30 PM. The isResolved status is set to false.
30+
31+
// Create a specific date: July 23, 2024, at 2:30:00 PM.
32+
let specificDate = new Date(2024, 6, 23, 14, 30, 0); // Note: July is represented by 6 (0-based index).
33+
34+
// Define the properties of the comment including author, date, and resolution status.
35+
let commentProperties = {
36+
author: 'Nancy Davolio', // The author of the comment.
37+
dateTime: specificDate, // The date and time when the comment is created.
38+
isResolved: false // The status of the comment; false indicates it is unresolved.
39+
};
40+
41+
// Insert the comment with the specified properties into the document editor.
42+
documentEditor.editor.insertComment('Hello world', commentProperties);
2243
```
2344

2445
## Comment navigation

0 commit comments

Comments
 (0)