This sample shows how you can customize the comment, such as format the comment text, set the comment's border, set the comment's position and size, and so on.
Before you add the comment, you can set the text for the comment using the text method. The position and size of the comment can also be changed. For example:
comment.location(new GC.Spread.Sheets.Point(62, 20));
Sometimes you might need to resize the row's height or the column's width, and you don't want the position or size of the comment to change. To do this, use the dynamicMove and dynamicSize methods. For example:
Note that if the comment's dynamicMove method is false and dynamicSize method is true, neither has an effect.
After you edit the comment's text, you can format the content, such as font, textDecoration, and so on. For example:
var padding1 = new GC.Spread.Sheets.Padding(10, 20, 30, 40);
You can add a border to the comment. The border is set as the DOM's border setting. For example:
When one comment object overlaps another, you can change the order from top to bottom by zIndex.
If you do not want the comment to change based on UI interaction, use the lock method to lock it. If you want to lock it, first lock the sheet. If you don't want the text to be changed, use the lockText method to lock the text.
sheet.options.isProtected = true;