diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/razor index e17a73cb43..4ee6c2c0df 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/razor +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/razor @@ -8,29 +8,9 @@ container = documenteditorElement.ej2_instances[0]; documenteditor = container.documentEditor; let mentionData = [ - { "Name": "Selma Rose", "Eimg": "3", "EmailId": "selma@mycompany.com" }, - { "Name": "Russo Kay", "Eimg": "8", "EmailId": "russo@mycompany.com" }, - { "Name": "Camden Kate", "Eimg": "9", "EmailId": "camden@mycompany.com" }, - { "Name": "Mary Kate", "Eimg": "4", "EmailId": "marry@mycompany.com" }, - { "Name": "Ursula Ann", "Eimg": "2", "EmailId": "ursula@mycompany.com" }, - { "Name": "Margaret", "Eimg": "5", "EmailId": "margaret@mycompany.com" }, - { "Name": "Laura Grace", "Eimg": "6", "EmailId": "laura@mycompany.com" }, - { "Name": "Robert", "Eimg": "8", "EmailId": "robert@mycompany.com" }, - { "Name": "Albert", "Eimg": "9", "EmailId": "albert@mycompany.com" }, - { "Name": "Michale", "Eimg": "10", "EmailId": "michale@mycompany.com" }, - { "Name": "Andrew James", "Eimg": "7", "EmailId": "james@mycompany.com" }, - { "Name": "Rosalie", "Eimg": "4", "EmailId": "rosalie@mycompany.com" }, - { "Name": "Stella Ruth", "Eimg": "2", "EmailId": "stella@mycompany.com" }, - { "Name": "Richard Rose", "Eimg": "10", "EmailId": "richard@mycompany.com" }, - { "Name": "Gabrielle", "Eimg": "3", "EmailId": "gabrielle@mycompany.com" }, - { "Name": "Thomas", "Eimg": "7", "EmailId": "thomas@mycompany.com" }, - { "Name": "Charles Danny", "Eimg": "8", "EmailId": "charles@mycompany.com" }, - { "Name": "Daniel", "Eimg": "10", "EmailId": "daniel@mycompany.com" }, - { "Name": "Matthew", "Eimg": "7", "EmailId": "matthew@mycompany.com" }, - { "Name": "Donald Krish", "Eimg": "9", "EmailId": "donald@mycompany.com" }, - { "Name": "Yohana", "Eimg": "1", "EmailId": "yohana@mycompany.com" }, - { "Name": "Kevin Paul", "Eimg": "10", "EmailId": "kevin@mycompany.com" }, - { "Name": "Andrew Fuller", "Eimg": "3", "EmailId": "andrew@mycompany.com"} + { "Name": "Mary Kate", "EmailId": "marry@company.com" }, + { "Name": "Andrew James", "EmailId": "james@company.com" }, + { "Name": "Andrew Fuller", "EmailId": "andrew@company.com"} ]; container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }}; } diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/tagHelper index ff5280635c..9cb0f15ead 100644 --- a/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/comments-mention/tagHelper @@ -9,29 +9,9 @@ container = documenteditorElement.ej2_instances[0]; documenteditor = container.documentEditor; let mentionData = [ - { "Name": "Selma Rose", "Eimg": "3", "EmailId": "selma@mycompany.com" }, - { "Name": "Russo Kay", "Eimg": "8", "EmailId": "russo@mycompany.com" }, - { "Name": "Camden Kate", "Eimg": "9", "EmailId": "camden@mycompany.com" }, - { "Name": "Mary Kate", "Eimg": "4", "EmailId": "marry@mycompany.com" }, - { "Name": "Ursula Ann", "Eimg": "2", "EmailId": "ursula@mycompany.com" }, - { "Name": "Margaret", "Eimg": "5", "EmailId": "margaret@mycompany.com" }, - { "Name": "Laura Grace", "Eimg": "6", "EmailId": "laura@mycompany.com" }, - { "Name": "Robert", "Eimg": "8", "EmailId": "robert@mycompany.com" }, - { "Name": "Albert", "Eimg": "9", "EmailId": "albert@mycompany.com" }, - { "Name": "Michale", "Eimg": "10", "EmailId": "michale@mycompany.com" }, - { "Name": "Andrew James", "Eimg": "7", "EmailId": "james@mycompany.com" }, - { "Name": "Rosalie", "Eimg": "4", "EmailId": "rosalie@mycompany.com" }, - { "Name": "Stella Ruth", "Eimg": "2", "EmailId": "stella@mycompany.com" }, - { "Name": "Richard Rose", "Eimg": "10", "EmailId": "richard@mycompany.com" }, - { "Name": "Gabrielle", "Eimg": "3", "EmailId": "gabrielle@mycompany.com" }, - { "Name": "Thomas", "Eimg": "7", "EmailId": "thomas@mycompany.com" }, - { "Name": "Charles Danny", "Eimg": "8", "EmailId": "charles@mycompany.com" }, - { "Name": "Daniel", "Eimg": "10", "EmailId": "daniel@mycompany.com" }, - { "Name": "Matthew", "Eimg": "7", "EmailId": "matthew@mycompany.com" }, - { "Name": "Donald Krish", "Eimg": "9", "EmailId": "donald@mycompany.com" }, - { "Name": "Yohana", "Eimg": "1", "EmailId": "yohana@mycompany.com" }, - { "Name": "Kevin Paul", "Eimg": "10", "EmailId": "kevin@mycompany.com" }, - { "Name": "Andrew Fuller", "Eimg": "3", "EmailId": "andrew@mycompany.com"} + { "Name": "Mary Kate", "EmailId": "marry@company.com" }, + { "Name": "Andrew James", "EmailId": "james@company.com" }, + { "Name": "Andrew Fuller", "EmailId": "andrew@company.com"} ]; container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }}; } diff --git a/ej2-asp-core-mvc/document-editor/comments.md b/ej2-asp-core-mvc/document-editor/comments.md index d4525f424c..2485fd4bdb 100644 --- a/ej2-asp-core-mvc/document-editor/comments.md +++ b/ej2-asp-core-mvc/document-editor/comments.md @@ -18,7 +18,28 @@ Document editor allows to add comments to documents. You can add, navigate and r Comments can be inserted to the selected text. ```typescript -documentEditor.editor.insertComment("Test comment"); +documentEditor.editor.insertComment('Test comment'); +``` + +## Add a New Comment with Date, Author, and Status + +Comments can be inserted into the selected text with a specified date, author, and status. + +```typescript +// 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. + +// Create a specific date: July 23, 2024, at 2:30:00 PM. +let specificDate = new Date(2024, 6, 23, 14, 30, 0); // Note: July is represented by 6 (0-based index). + +// Define the properties of the comment including author, date, and resolution status. +let commentProperties = { + author: 'Nancy Davolio', // The author of the comment. + dateTime: specificDate, // The date and time when the comment is created. + isResolved: false // The status of the comment; false indicates it is unresolved. +}; + +// Insert the comment with the specified properties into the document editor. +documentEditor.editor.insertComment('Hello world', commentProperties); ``` ## Comment navigation