[]
Sheets.ThreadedComments.ThreadedCommentManager
• new ThreadedCommentManager()
表示一个用于在工作表上添加、检索、删除、枚举和序列化嵌套评论的嵌套评论管理器。
▸ add(row, col, replies?): null | ThreadedComment
向指定单元格添加评论。
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 |
行索引。 |
col |
number |
列索引。 |
replies? |
IReply[] |
要追加的回复。 |
null | ThreadedComment
评论实例。
▸ all(): ThreadedComment[]
获取工作表上所有的评论,并将其放入一个数组中。
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const allComments = threadedCommentManager.all();
console.log(allComments);
▸ clear(range?): void
清除指定范围内的评论。如果未指定范围,则清除工作表中的所有评论。
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.clear(new GC.Spread.Sheets.Range(1, 1, 3, 3));
| Name | Type | Description |
|---|---|---|
range? |
Range |
要从中清除所有评论的范围。 |
void
▸ get(row, col): undefined | ThreadedComment
获取指定单元格的评论。
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const threadedComment = threadedCommentManager.get(1, 1);
console.log(threadedComment);
| Name | Type | Description |
|---|---|---|
row |
number |
行索引。 |
col |
number |
列索引。 |
undefined | ThreadedComment
▸ remove(row, col): undefined | ThreadedComment
删除指定单元格处的评论。
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.remove(1, 1);
| Name | Type | Description |
|---|---|---|
row |
number |
行索引。 |
col |
number |
列索引。 |
undefined | ThreadedComment
▸ size(): number
获取工作表上的评论数量。
example
const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const size = threadedCommentManager.size();
console.log(size);
number