[]
        
(Showing Draft Content)

GC.Spread.Sheets.ThreadedComments.ThreadedCommentManager

Class: ThreadedCommentManager

Sheets.ThreadedComments.ThreadedCommentManager

Table of contents

Constructors

Methods

Constructors

constructor

new ThreadedCommentManager()

Represent a threaded comment manager for adding, retrieving, removing, enumerating and serializing threaded comments on a worksheet.

Methods

add

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

Parameters

Name Type Description
row number Row index.
col number Column index.
replies? IReply[] -

Returns

null | ThreadedComment

The threaded comment instance.


all

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

Returns

ThreadedComment[]


clear

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

Parameters

Name Type
range? Range

Returns

void


get

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

Parameters

Name Type Description
row number Row index.
col number Column index.

Returns

undefined | ThreadedComment


remove

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

Parameters

Name Type Description
row number Row index.
col number Column index.

Returns

undefined | ThreadedComment


size

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

Returns

number