Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 77 additions & 13 deletions Document-Processing/Excel/Spreadsheet/Javascript-ES6/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ documentation: ug

# Notes in EJ2 TypeScript Spreadsheet control

The **Notes** feature is used to insert comments, provide feedback, suggest changes, or leave remarks on specific cells while reviewing documents in the Spreadsheet. You can enable or disable the notes functionality using the [`enableNotes`](https://ej2.syncfusion.com/documentation/api/spreadsheet/#enablenotes) property, which defaults to **true**.
The **Notes** feature is used to insert comments, provide feedback, suggest changes, or leave remarks on specific cells while reviewing documents in the Spreadsheet. You can enable or disable the notes functionality using the [enableNotes](https://ej2.syncfusion.com/documentation/api/spreadsheet/index-default#enablenotes) property, which defaults to **true**.

When opening the Excel document with notes in the Spreadsheet, they will be displayed in the control. The cells containing notes will be indicated with a red colored triangle at the top-right corner. Hovering the mouse over these cells will display the content of the notes.

Expand All @@ -32,38 +32,100 @@ In the below example, you can add, edit, save, and delete notes.

In the active worksheet, you can add a note in the following ways:

* To add a note, right-click the cell to open the context menu and choose the **"Add Note"** option from the context menu. This will open a dialog box to add the content as a note.
* You can also use the `Shift` + `F2` keyboard shortcut to add a note to the desired cell. A dialog box will be opened to add the content as a note.
* After entering the content in the dialog box, you can either click on other cells or press the `Esc` button on the keyboard to automatically save the note in the cell and close the dialog box.
* **Context Menu**: Right-click the desired cell and select **Add Note**.
* **Ribbon**: Select the cell, navigate to the **Review** tab, click the **Notes** dropdown, and select **Add Note**.
* **Keyboard Shortcut**: Select the cell and press <kbd>Shift</kbd> + <kbd>F2</kbd>.

A dialog box will open where you can enter the note content. After entering the content, you can either click on other cells or press the <kbd>Esc</kbd> button to automatically save the note and close the dialog box.

![Adding a note in Spreadsheet](./images/spreadsheet_add_note.gif)

## Editing a note

In the active worksheet, you can modify the content of existing notes in the document.
In the active worksheet, you can modify the content of existing notes in the document:

* **Context Menu**: Right-click the cell containing the note and select **Edit Note**.
* **Ribbon**: Select the cell containing the note, navigate to the **Review** tab, click the **Notes** dropdown, and select **Edit Note**.
* **Keyboard Shortcut**: Select the cell containing the note and press <kbd>Shift</kbd> + <kbd>F2</kbd>.

* To edit a note, right-click on the desired cell containing the note, which will open the context menu.
* Select the **"Edit Note"** option from the context menu.
* You can also use the `Shift` + `F2` keyboard shortcut to edit the note of the desired cell. A dialog box will be opened to edit the note.
* After editing the content in the dialog box, you can either click on other cells or press the `Esc` button on the keyboard to automatically save the note in the cell and close the dialog box.
The note editor dialog box will open with the existing content. After editing the content, you can either click on other cells or press the <kbd>Esc</kbd> button to automatically save the changes and close the dialog box.

![Editing a note in Spreadsheet](./images/spreadsheet_edit_note.gif)

## Deleting a note

In the active worksheet, right-click on the desired cell containing the note that you want to remove, which opens the context menu. In the context menu, select the **"Delete Note"** option to delete the note.
You can remove notes from cells using the following ways:

* **Context Menu**: Right-click the cell containing the note and select **Delete Note**.
* **Ribbon**: Select the cell containing the note, navigate to the **Review** tab, click the **Notes** dropdown, and select **Delete Note**.

The note will be removed from the cell, and the red triangle indicator will be removed.

![Deleting a note in Spreadsheet](./images/spreadsheet_delete_note.gif)

## Navigating between notes

The Syncfusion Spreadsheet provides intuitive navigation to quickly move between cells containing notes in your worksheet. These options are accessible through the **Notes** dropdown in the **Review** tab.

### Previous Note

To navigate to the previous note:

* In the **Review** tab, open the **Notes** dropdown and select **Previous Note**.
* The Spreadsheet will automatically select the previous note in the current worksheet, searching leftward and then upward.
* If no prior note exists in the sheet, the search continues to the previous worksheet in order.
* If the workbook contains no notes, the selection remains on the current cell.

### Next Note

To navigate to the next note:

* In the **Review** tab, open the **Notes** dropdown and select **Next Note**.
* The Spreadsheet will automatically select the next note in the current worksheet, searching rightward and then downward.
* If no subsequent note exists in the sheet, the search continues to the next worksheet in order.
* If the workbook contains no notes, the selection remains on the current cell.

This functionality streamlines the process of reviewing notes across worksheets, ensuring efficient traversal and discovery.

## Show/Hide Note

The **Show/Hide Note** option allows you to toggle the visibility of individual notes as sticky notes within the worksheet. When enabled, the note appears as a persistent floating text box, making it convenient to reference key information without hovering over the cell.

To toggle the visibility of a note:

* **Context Menu**: Right-click the cell containing the note and select **Show/Hide Note**.
* **Ribbon**: Select the cell, go to the **Review** tab, click the **Notes** dropdown, and choose **Show/Hide Note**.

**Behavior:**

* **Default State (Hidden)**: Notes are hidden by default and only appear when hovering over the cell, which displays a red triangle indicator.
* **Sticky State (Visible)**: Toggling Show/Hide Note on a hidden note makes it visible as a sticky note, which remains on display even when navigating to other cells or selections.
* **Toggle Functionality**: Selecting Show/Hide Note again on a visible note hides it, reverting to the default state.
* **Independent Control**: Each note can be toggled individually, allowing you to display only the most relevant notes for your current task.

## Show All Notes

The **Show All Notes** option enables you to display all notes in the current worksheet simultaneously as sticky notes, simplifying the review of multiple comments at a glance.

To activate:

* Navigate to the **Review** tab, click the **Notes** dropdown, and select **Show All Notes**.

All notes in the worksheet will appear as floating text boxes near their respective cells.

> **Note**: After using Show All Notes, you can hide individual notes selectively via the **Show/Hide Note** option. Additionally, any new notes added to the worksheet will automatically appear as visible sticky notes when Show All Notes is active.

This functionality enhances workflow efficiency by providing flexible control over note visibility, whether for individual focus or comprehensive review.

## Saving the document with notes

The Spreadsheet data, including notes, can be saved and exported as an Excel document by selecting **File > Save As** in the ribbon menu. Exporting worksheets with notes is supported in Excel file formats such as MS Excel (.xlsx) and MS Excel 97-2003 (.xls).
The Spreadsheet data, including notes, can be saved and exported as an Excel document by selecting **File > Save As** in the ribbon menu. Exporting worksheets with notes is supported in Excel file formats such as Microsoft Excel (.xlsx) and Microsoft Excel 97-2003 (.xls).

> When exporting the Spreadsheet to file formats such as Comma Separated Values (.csv), Excel Macro-Enabled Workbook (.xlsm), Excel Binary Workbook (.xlsb), and PDF Document (.pdf), the notes will not be available.

## Disabling notes

To disable the note functionality, you need to set the [`enableNotes`](https://ej2.syncfusion.com/documentation/api/spreadsheet/#enablenotes) property to **false**. After disabling, the notes in the document will not be shown when opened in the Spreadsheet. The **"Add Note"** option will not be shown in the context menu. The keyboard shortcuts for the note functionality will not work.
To disable the note functionality, you need to set the [enableNotes](https://ej2.syncfusion.com/documentation/api/spreadsheet/index-default#enablenotes) property to **false**. After disabling, the notes in the document will not be shown when opened in the Spreadsheet. The **Add Note** option will not be shown in the context menu. The keyboard shortcuts for the note functionality will not work.

![Spreadsheet with notes feature disabled](./images/spreadsheet_notes_disable.png)

Expand All @@ -82,7 +144,9 @@ In the below example, the note functionality is disabled in the Spreadsheet.

## Integrating notes during initial loading and using cell data binding

The notes can be added initially when the Spreadsheet loads using cell data binding. You need to use the `notes` property in the cell settings to add notes to the Spreadsheet.
The notes can be added initially when the Spreadsheet loads using cell data binding. You need to use the [notes](https://ej2.syncfusion.com/documentation/api/spreadsheet/cell#notes) property in the cell settings to add notes to the Spreadsheet.

In the below example, you can navigate between notes using **Previous Note** and **Next Note** options, toggle individual note visibility with **Show/Hide Note**, and display all notes at once using **Show All Notes**.

{% tabs %}
{% highlight ts tabtitle="index.ts" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link rel="shortcut icon" href="resources/favicon.ico" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/shim.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ System.config({
}
},
paths: {
"syncfusion:": "https://cdn.syncfusion.com/ej2/26.1.35/"
"syncfusion:": "https://cdn.syncfusion.com/ej2/32.1.19/"
},
map: {
main: "index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link rel="shortcut icon" href="resources/favicon.ico" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/shim.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ System.config({
}
},
paths: {
"syncfusion:": "https://cdn.syncfusion.com/ej2/26.1.35/"
"syncfusion:": "https://cdn.syncfusion.com/ej2/32.1.19/"
},
map: {
main: "index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link rel="shortcut icon" href="resources/favicon.ico" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/26.1.35/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/material.css" rel="stylesheet" />
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-grids/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/32.1.19/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/shim.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ var sheet = [
cells: [
{
value: 'Sports Shoes',
notes:
'These shoes have the highest sales in terms of quantity this month.',
notes: {
text: 'These shoes have the highest sales in terms of quantity this month.',
isVisible: true
},
},
{ value: 'IN STOCK' },
{ value: 'Overstack' },
{
value: 'Overstack',
notes: { text: 'This website is best for buying sports shoes.' },
},
],
},
{
Expand All @@ -43,10 +48,7 @@ var sheet = [
},
{
cells: [
{
value: 'Flip-Flops & Slippers',
notes: 'These shoes have been the most profitable this month.',
},
{ value: 'Flip-Flops & Slippers' },
{ value: 'IN STOCK' },
{ value: 'Taobao' },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ let sheet: SheetModel[] = [
cells: [
{
value: 'Sports Shoes',
notes:
'These shoes have the highest sales in terms of quantity this month.',
notes: {
text: 'These shoes have the highest sales in terms of quantity this month.',
isVisible: true
},
},
{ value: 'IN STOCK' },
{ value: 'Overstack' },
{
value: 'Overstack',
notes: { text: 'This website is best for buying sports shoes.' },
},
],
},
{
Expand All @@ -45,10 +50,7 @@ let sheet: SheetModel[] = [
},
{
cells: [
{
value: 'Flip-Flops & Slippers',
notes: 'These shoes have been the most profitable this month.',
},
{ value: 'Flip-Flops & Slippers' },
{ value: 'IN STOCK' },
{ value: 'Taobao' },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ System.config({
}
},
paths: {
"syncfusion:": "https://cdn.syncfusion.com/ej2/26.1.35/"
"syncfusion:": "https://cdn.syncfusion.com/ej2/32.1.19/"
},
map: {
main: "index.ts",
Expand Down