[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
在线咨询 立即试用
(Showing Draft Content)

GC.Spread.Sheets.ThreadedComments.ThreadedCommentManager

Class: ThreadedCommentManager

Sheets.ThreadedComments.ThreadedCommentManager

Table of contents

Constructors

Methods

Constructors

constructor

• new ThreadedCommentManager()

表示一个用于在工作表上添加、检索、删除、枚举和序列化嵌套评论的嵌套评论管理器。

Methods

add

▸ 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);

Parameters

Name Type Description
row number 行索引。
col number 列索引。
replies? IReply[] 要追加的回复。

Returns

null | ThreadedComment

评论实例。


all

▸ all(): ThreadedComment[]

获取工作表上所有的评论,并将其放入一个数组中。

example

const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const allComments = threadedCommentManager.all();
console.log(allComments);

Returns

ThreadedComment[]


clear

▸ clear(range?): void

清除指定范围内的评论。如果未指定范围,则清除工作表中的所有评论。

example

const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.clear(new GC.Spread.Sheets.Range(1, 1, 3, 3));

Parameters

Name Type Description
range? Range 要从中清除所有评论的范围。

Returns

void


get

▸ get(row, col): undefined | ThreadedComment

获取指定单元格的评论。

example

const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const threadedComment = threadedCommentManager.get(1, 1);
console.log(threadedComment);

Parameters

Name Type Description
row number 行索引。
col number 列索引。

Returns

undefined | ThreadedComment


remove

▸ remove(row, col): undefined | ThreadedComment

删除指定单元格处的评论。

example

const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
threadedCommentManager.remove(1, 1);

Parameters

Name Type Description
row number 行索引。
col number 列索引。

Returns

undefined | ThreadedComment


size

▸ size(): number

获取工作表上的评论数量。

example

const activeSheet = spread.getActiveSheet();
const threadedCommentManager = activeSheet.threadedComments;
const size = threadedCommentManager.size();
console.log(size);

Returns

number