[]
Sheets.ThreadedComments.ThreadedCommentManager
• new ThreadedCommentManager()
Represent a threaded comment manager for adding, retrieving, removing, enumerating and serializing threaded comments on a worksheet.
▸ add(row, col, replies?): null | ThreadedComment
Add a threaded comment to the specified cell.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const tc = threadedCommentManager.add(1, 1);
tc.add({ message: [{ type: GC.Spread.Sheets.ThreadedComments.ContentType.text, value: 'hello' }] });
const allReplies = tc.all();
console.log(allReplies);
| Name | Type | Description |
|---|---|---|
row |
number |
Row index. |
col |
number |
Column index. |
replies? |
IReply[] |
- |
null | ThreadedComment
The threaded comment instance.
▸ all(): ThreadedComment[]
Get all threaded comments on the worksheet in an array.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const allComments = threadedCommentManager.all();
console.log(allComments);
▸ clear(range?): void
Clear the threaded comments in the specified range. When the range is not specified, it clears all the threaded comments in the sheet.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.clear(new GC.Spread.Sheets.Range(1, 1, 3, 3));
| Name | Type |
|---|---|
range? |
Range |
void
▸ get(row, col): undefined | ThreadedComment
Get the threaded comment at the specified cell.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const threadedComment = threadedCommentManager.get(1, 1);
console.log(threadedComment);
| Name | Type | Description |
|---|---|---|
row |
number |
Row index. |
col |
number |
Column index. |
undefined | ThreadedComment
▸ remove(row, col): undefined | ThreadedComment
Remove the threaded comment at the specified cell.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.remove(1, 1);
| Name | Type | Description |
|---|---|---|
row |
number |
Row index. |
col |
number |
Column index. |
undefined | ThreadedComment
▸ size(): number
Get the number of threaded comments on the worksheet.
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const size = threadedCommentManager.size();
console.log(size);
number