Configuring Comments

View as Markdown

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:

PropertyRequiredSection
loadCommentThreadsYesSetting up Comments
persistCommentThreadsYesSetting up Comments
isCellCommentableNoCommentable Cells
dateFormatNoTimestamp Date Format
showCommentActionNoViewing Comments
showPopupCloseButtonNoViewing 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) => boolean
Function enabling specific Cells to be excluded from Comments
Configuring Commentable Cells
Fork
  • isCellCommentable in adaptableOptions.ts blocks Comments when:
    • the cell is in the language column
    • the row’s license value is Other
Try It Out
  • Right-click a cell in name — Add Comment is available
  • Right-click a cell in language, or any cell in a row whose license is Other — Add Comment is not offered
Loading demo…

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.

Comments CSS
Fork
  • styles.css sets --ab-CellComment-triangle-color so the comment triangle appears yellow
Loading demo…

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:ss
String
Date Format to use for timestamp in Comments
Comments Date Format
Fork
  • dateFormat: 'MMM do yyyy' in adaptableOptions.ts for Comment timestamps
Loading demo…

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'
Whether Comments open on hover or via the Context Menu
Comments Menu
Fork
  • showCommentAction: 'menu' in adaptableOptions.ts — hovering a commented cell does nothing
  • Right-click the cell and choose Show Comment to open the thread
Loading demo…

showPopupCloseButton

Default: true
Boolean
Show a Close Button on the Comments popup