CommentOptions

View as Markdown

Comments on cells. A thread is the list of comments for one cell.

Comments are not stored in AdapTable State. The application loads them with and saves them with .

TypeScript
export interface

Properties

PropertyTypeDescriptionDefault
dateFormatstring | (() => string)Date Format string for Comments timestamp'dd-MM-yyyy HH:mm:ss'
isCellCommentable(commentableCellContext:CommentableCellContext) => booleanFunction to configure if a cell can contain Comments
showCommentAction'hover' | 'menu'Whether to show Comments by hovering (default) or via context menu'hover'
showPopupCloseButtonbooleanShow the Close Button in the Comments Popuptrue

Methods

MethodReturnsDescription
loadCommentThreads(commentLoadContext)Promise<CommentThread[]>Loads every comment thread when the grid starts.
persistCommentThreads(commentThreads)Promise<void>Saves the threads after a comment is added, edited or deleted.

Called with the full set, not only the thread that changed.

Property Details

dateFormat

Date Format string for Comments timestamp

TypeScript
dateFormat?: string | (() => string);
Default Value

'dd-MM-yyyy HH:mm:ss'

Property Value

string | (() => string)

isCellCommentable

Function to configure if a cell can contain Comments

TypeScript
isCellCommentable?: (commentableCellContext: CommentableCellContext) => boolean;
Property Value

(commentableCellContext:CommentableCellContext) => boolean

showCommentAction

Whether to show Comments by hovering (default) or via context menu

TypeScript
showCommentAction?: 'hover' | 'menu';
Default Value

'hover'

Property Value

'hover' | 'menu'

showPopupCloseButton

Show the Close Button in the Comments Popup

TypeScript
showPopupCloseButton?: boolean;
Default Value

true

Property Value

boolean

Method Details

loadCommentThreads

Loads every comment thread when the grid starts.

TypeScript
loadCommentThreads?(commentLoadContext: CommentLoadContext): Promise<CommentThread[]>;
Parameters
ParameterTypeDescription
commentLoadContextCommentLoadContextThe grid the comments belong to
Returns

The threads to show. An empty list when there are none

Promise<CommentThread[]>

persistCommentThreads

Saves the threads after a comment is added, edited or deleted.

Called with the full set, not only the thread that changed.

TypeScript
persistCommentThreads?(commentThreads: CommentThread[]): Promise<void>;
Parameters
ParameterTypeDescription
commentThreadsCommentThread[]Every thread, including the one that just changed
Returns

Promise<void>