Configuring Comments
Summary
- Developers can configure which Cells in the Grid are able to receive Comments
- Comments open on hover by default, or via the Context Menu (
showCommentAction) - And like everything in AdapTable, Comments can be easily themed using CSS Variables
Comments are not available until you provide both load and persist functions in commentOptions on Adaptable Options.
Note
Comments use a very similar loading and persisting pattern as Team Sharing
CommentOptions defines six properties:
| Property | Required | Section |
|---|---|---|
loadCommentThreads | Yes | Setting up Comments |
persistCommentThreads | Yes | Setting up Comments |
isCellCommentable | No | Commentable Cells |
dateFormat | No | Timestamp Date Format |
showCommentAction | No | Viewing Comments |
showPopupCloseButton | No | Viewing Comments |
Developer Guide
Setting up Comments
Hint
The Comment module follows the same Entitlements as other modules (defaultAccessLevel is Full). If you have set defaultAccessLevel to Hidden, grant Comment Full or ReadOnly or the UI will stay hidden even after load and persist are wired up.
Commentable Cells
By default all cells in AG Grid - even readonly ones - can receive a Comment.
isCellCommentable
(commentableCellContext: CommentableCellContext) => booleanisCellCommentableinadaptableOptions.tsblocks Comments when:- the cell is in the
languagecolumn - the row’s
licensevalue isOther
- the cell is in the
- Right-click a cell in
name— Add Comment is available - Right-click a cell in
language, or any cell in a row whoselicenseisOther— Add Comment is not offered
Theming Comments
By default the triangle in a cell to denote a Comment is painted blue.
Note
Technically AdapTable uses the value of the --ab-color-info variable, which itself can be overridden
However, like everything theming-related in AdapTable, this can be overridden using CSS Variables.
All that is required is to provide a different value for the --ab-CellComment-triangle-color CSS variable.
styles.csssets--ab-CellComment-triangle-colorso the comment triangle appears yellow
Timestamp Date Format
AdapTable provides a property to configure how the timestamp of a Comment is displayed.
Note
This is used in both the Comment itself and the Comments screen that shows all current Comments
dateFormat
Default: dd-MM-yyyy HH:mm:ssStringdateFormat: 'MMM do yyyy'inadaptableOptions.tsfor Comment timestamps
Viewing Comments
By default run-time users see a Comment when the mouse hovers over a cell that contains one.
Set showCommentAction in Comment Options to 'menu' to turn off hover and open the thread from the Context Menu instead (Show Comment).
Use showPopupCloseButton (default true) to show or hide the Close button on the Comments popup.
showCommentAction
Default: hover'hover' | 'menu'showCommentAction: 'menu'inadaptableOptions.ts— hovering a commented cell does nothing- Right-click the cell and choose Show Comment to open the thread
showPopupCloseButton
Default: trueBoolean